-
Notifications
You must be signed in to change notification settings - Fork 3k
Route priority #1277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I believe routes are matched in the order they are defined. However, exact matches take precedence over parameterized matches. |
Is there a way to supply a number for priority? I can't specify the order
|
no, sorry, not currently possible. |
it doesn't look like exact matches have a higher priority... |
@orrgal1 I could have been wrong about that, sorry. I'm not sure if we have specified that behavior |
no worries thanks, just wanted to make sure On Tue, Jun 16, 2015 at 4:30 AM, Chris Thielen [email protected]
|
Found a solution here: http://stackoverflow.com/questions/26389177/angularjs-ui-router-incorrectly-interpreting-url-path-as-paremeter-in-urlroute Explicitly defining the higher priority route in the $urlRouterProvider works. ex:
|
I also have this problem. It would be nice if routes declared earlier had priority, or there was some sort of smart detection to see which route is more general. Is this fixed in ui-router 2? Just to show what routes were giving me trouble:
In this case, |
@aeharding what version of ui-router are you on? I think we merged in a PR that tries to prioritize urls based on the length of the prefix (params don't count as prefix) |
Hi, I ran into the same issue and this is what I found so far:
Is there any news about it? |
We have a naïve sorting implementation that is currently broken in 1.0alpha0 but is being patched in alpha1. We plan to expose an API for managing sort order at some point down the road in 1.0. |
@christopherthielen I tried upgrading to that release, but unfortunately, it did not fix the problem. I ended up switching the order of the state declaration, but I still think Good to hear that v1 might fix this. 👍 |
See #2502 |
If you're using a numerical |
Was this resolved at all? I couldn't tell from 2502... I've just found this issue with nest params on 1.0.3
The new route was unreachable. |
This issue has been automatically marked as stale because it has not had This does not mean that the issue is invalid. Valid issues Thank you for your contributions. |
GitHub has its
/settings
route with a higher priority than the/:username
route. Is this possible with ui-router? I wasn't able to find any documentation on it. Thanks.The text was updated successfully, but these errors were encountered: