You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This happens even when the wildcard route is a child route of '/', which is kinda strange. I do think that "root" routes should have higher priority than child routes.
Hey, thanks for opening the issue.
This is indeed a caveat of dynamically added routes. FTM you'll have to add the wild card route after any other route.
Another option would be to optionally make addRoutes override old routes (.addRoutes(newRoutes,{ override: true })), so you can construct a new routes array externally the way you need it?
wasdujk, LttianGit, MackieLee, wangjing013 and Angelabobby
We can also keep track of any asterisk route (path: '*') so dynamically added routes are always added before that one.
People will still have issues if there's some route with foo-* and they dynamically add routes like foo-lol and foo-bar but I don't see a real world example about a partial asterisk while having an asterisk route is very common
nickforddev, DanielPe05, CubePoint, Fancyhr, lvisei and 5 more
Is there an update for this? I just ran into it. I think that keeping track of path: '*' and adding dynamic routes before it as suggested by @posva is the simplest, quickest solution. However as a more complete fix that would give more flexibilities, I think being able to appendRoute/prependRoute makes more sense.
Activity
Dadibom commentedon Feb 17, 2017
This happens even when the wildcard route is a child route of '/', which is kinda strange. I do think that "root" routes should have higher priority than child routes.
posva commentedon Feb 18, 2017
Hey, thanks for opening the issue.
This is indeed a caveat of dynamically added routes. FTM you'll have to add the wild card route after any other route.
ping @fnlctrl @yyx990803
Dadibom commentedon Feb 18, 2017
Maybe there could be an option to prepend the new routes instead of appending them?
fnlctrl commentedon Feb 18, 2017
Hmm maybe dynamically added routes should have higher priority than the statically defined ones?
@Dadibom Yeah an option seems nice
LinusBorg commentedon Feb 22, 2017
Another option would be to optionally make
addRoutes
override old routes (.addRoutes(newRoutes,{ override: true })
), so you can construct a newroutes
array externally the way you need it?posva commentedon Feb 22, 2017
We can also keep track of any asterisk route (
path: '*'
) so dynamically added routes are always added before that one.People will still have issues if there's some route with
foo-*
and they dynamically add routes likefoo-lol
andfoo-bar
but I don't see a real world example about a partial asterisk while having an asterisk route is very commonDadibom commentedon Feb 23, 2017
I'd be fine with any of the solutions mentioned, but I think the most transparent one would be appendRoutes / prependRoutes / replaceRoutes
DanielPe05 commentedon Apr 3, 2017
Is there an update for this? I just ran into it. I think that keeping track of
path: '*'
and adding dynamic routes before it as suggested by @posva is the simplest, quickest solution. However as a more complete fix that would give more flexibilities, I think being able toappendRoute
/prependRoute
makes more sense.5 remaining items