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
It does fire the '' route if the user adds a slash to the end of the url:
http://my.app.com/root/
I noticed that in the start function for history, it calls this.loadUrl() without params. This ends up getting translated as a fragment of 'root' on your side and tries to get matched to my list of routes. Since I don't have a route called 'root', it doesn't match.
My question is, shouldn't you infer in loadUrl that root should point to the empty route and hit the index function like above? Otherwise I need to add 'root' as a route and point to the index function in addition to the empty route.
The text was updated successfully, but these errors were encountered:
This is definitely a bit different than #1366, but somewhat related. I'm wondering if perhaps we should strip the trailing slash from the root so that the comparison works either way? Navigating to "/root" instead of "/root/" seems reasonable to me. I'll take a stab at it and see what edge cases pop up.
I have an app where the url is in the format:
http://my.app.com/root
My routes look like this:
However when I call Backbone history start:
and the user navigates to http://my.app.com/root, it does not fire the '' route:
It does fire the '' route if the user adds a slash to the end of the url:
http://my.app.com/root/
I noticed that in the start function for history, it calls this.loadUrl() without params. This ends up getting translated as a fragment of 'root' on your side and tries to get matched to my list of routes. Since I don't have a route called 'root', it doesn't match.
My question is, shouldn't you infer in loadUrl that root should point to the empty route and hit the index function like above? Otherwise I need to add 'root' as a route and point to the index function in addition to the empty route.
The text was updated successfully, but these errors were encountered: