URL in navigation works - goto not
See repo - https://github.com/Tommertom/svelte-ionic-app/tree/2.ListStarter
Component AppMessage.svelte uses a $goto to go to route "message/3"
https://github.com/Tommertom/svelte-ionic-app/blob/2.ListStarter/src/components/AppMessage.svelte
Entering the full URL in the address bar works, a goto to the same doesn't - error "could not find destination node message/3"
Route /message is located in folder message with [id].svelte as receiving end.
https://github.com/Tommertom/svelte-ionic-app/tree/2.ListStarter/src/routes/message
$url("/message/[id]", { id: "5" }) does show the message/5 url, so it is a valid route in the db. But then it ends here...
Hi @Tommertom. Does $goto("/message/[id]", { id: "5" }) work?
$goto("/message/[id]", { id: "5" })
Like a charm!
So does this mean a goto with full path is not supported as way to change route? Was it my thinking, or something that worked in Routify2 -right? Then at least, it might be worthwhile mentioning in the documentation.
And if it is not intended this way, then this issue imho turns into a feature request with high prio.... Other routers support full path as input.
So not sure if I concur with a "solved" label.
And to be honest, I need to look at mycode, because I have an app in r3 which does allow full path, and this one doesn't - while it is a direct copy. I am confused.
Goto with a full path would just be an alias for the native history.pushState.
That said, the next patch may include an option that allows the use of a compiled path. The work has already been done for node.traverse(path, allowDynamic) where the second parameter enables compiled paths.
For URL helpers like $url and $goto, the solution might be
$<helper>(path, params, options)
So in your case it would be like this pseudo code $goto('/some/path', {}, { dynamic: true }).