Skip to content

ui-sref incorrectly adds state parameters to urls when current state has those parameters #564

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
TimothyKrell opened this issue Nov 7, 2013 · 2 comments

Comments

@TimothyKrell
Copy link

Problem: ui-sref="route1" will incorrectly generate a url of href="route1?param1=something&param2=somethingelse"

Steps to reproduce:

  1. Define a state with search parameters (url: 'route1?param1&param2')
  2. Use ui-sref to define two links, one to just /route1 (ui-sref="route1") and one to /route1?param1=something&param2=somethingelse (ui-sref="route1({ param1: 'something', param2: 'somethingelse' }))
  3. browse to /route1. Everything is as expected. ui-sref="route1" generates /route1 and ui-sref="route1({ param1: 'something', param2: 'somethingelse' }) generates /route1?param1=something&param2=somethingelse
  4. browse to /route1?param1=something&param2=somethingelse. Both ui-sref directives generate a url of /route1?param1=something&param2=somethingelse. This is not expected and problematic. The first ui-sref (ui-sref="route1") should still generate a url of /route1

Here is a plunker demonstrating the problem.

@nateabele
Copy link
Contributor

See #504.

@TimothyKrell
Copy link
Author

Ah! Sorry. I looked before I submitted, but I guess I didn't search hard enough.

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

No branches or pull requests

2 participants