Skip to content

Don't keep stateParams when transitioning between unrelated states #930

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
ghengeveld opened this issue Mar 4, 2014 · 2 comments
Closed

Comments

@ghengeveld
Copy link

When following links created by uiSref, any params present on the current state will be retained. This can lead to broken links since not all pages have the same params, and if they do the possible values may differ.

I suggest not keeping the stateParams when transitioning between two states that aren't in the same hierarchy (e.g. they or their ancestors are siblings).

My app has several unrelated pages with params for sorting/filtering/pagination. It doesn't make sense to have these params be retained between unrelated pages. Right now I've defined a 'clearParams' object which has all the params set to undefined, which I pass to uiSref. That works but it's ugly.

@roryf
Copy link

roryf commented Mar 4, 2014

The ui-sref-opts attribute introduced in #813 should solve this for you, by specifying inherit: false.

@timkindberg
Copy link
Contributor

Dupe #504

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

3 participants