question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

broken path/query params

See original GitHub issue

hello currently I’m observing a problem on ui-router/angular when having a “special” character in my path or query param. Currently I’m using ui-router/angular with version 2.0.0, the “newest”, however it’s also reproducible on older versions, see the hello world plunker that I changed: https://plnkr.co/edit/5zgTiwtTCp05Vce545gs if you click on ‘About’ you will see a logging output to the browser console. Normally you should only see resolve once, however it will be called twice.

this only happens when trying to open a url with [uiParams] where one param has a special character (whitespace, etc). the thing is that ui-router correctly decodes the param and I guess that is also the bug.

Currently the second time the route gets called the query parameter is encoded, so calling a transition.params() will only get the encoded version (I guess that is wrong behavior, too).

The bug only happens if you click on a uiSref link, not if you reload the browser with the correct url.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:7
  • Comments:5

github_iconTop GitHub Comments

5reactions
mkoczorowskicommented, Jun 22, 2018

hey you have to set this param to raw:true in param declaration

1reaction
paulodradecommented, Jun 20, 2018

Same problem!!!

When I have a path like /login?redirectTo=/channel (that encodes to /login?redirectTo=%2Fchannel) it is triggering twice (include the component). And if I try to refresh the page a couple of times, with this path (/login?redirectTo=%2Fchannel), it keeps re-encoding the path again and again, ending up something like /login?redirectTo=%25252525252525252Fchannel.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use Querystring with $location.path() in AngularJS
I want to change path and search the same time. ... compose(). It is not documented and it could broke at any new...
Read more >
Path segment vs query parameters? - Google Groups
path parameters are required/ url cache-able, while query params are optional, and query or object cache-able? so in this case, path parameters allow...
Read more >
How to programatically setup default query params after model?
Here's the deal: You're able to set default values for query params, so that when the query param matches the original value, ember...
Read more >
Leading slash for destination param should not be stripped ...
Problem/Motivation When a redirect is being created, the current path the user is visiting is appended as a "destination" query param.
Read more >
Angular Router Query Params Relative Routing - StackBlitz
routerLink="/home/catalog" [queryParams]=". {slide:2}">Catalog Params</a>. <router-outlet></router-outlet>. <a routerLinkActive="active".
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found