Skip to content

$urlRouterProvider.otherwise breaks routes with tildes. #2540

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

Closed
ddelemeny opened this issue Feb 8, 2016 · 2 comments · Fixed by #3050
Closed

$urlRouterProvider.otherwise breaks routes with tildes. #2540

ddelemeny opened this issue Feb 8, 2016 · 2 comments · Fixed by #3050
Labels

Comments

@ddelemeny
Copy link

Version : 0.2.18

Problem : using ui-sref, urls with tildes are wrongly redirected to the "default" state defined with $urlRouterProvider.otherwise, even if the correct route is resolved and executed.
Probably caused by 02e9866

Plunkr example

@christopherthielen
Copy link
Contributor

Confirmed; and thanks for the plunker. A workaround if you'd like to use 0.2.16-0.2.18 is to change your regexp to ~~[a-z]+ for now.

  • Path parameters auto-choose the 'string' type
  • If a path params has a regular expression, we still auto-choose the 'string' type, but apply the regexp to it
  • the 'string' type needs an escape character (not url-encoding) to specially encode/decode slashes. tilde was chosen as that character

I thought we had put this issue to bed, but hadn't considered the interplay with regexp!
Sorry for the troubles!

@christopherthielen christopherthielen added this to the 0.2.19 milestone Feb 8, 2016
@ddelemeny
Copy link
Author

No worries, thanks for the workaround !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants