-
Notifications
You must be signed in to change notification settings - Fork 3k
fix(ui-sref): Allow sref state options to take a scope object #1141
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
Conversation
Is this just a convenient alternative to |
The idea is that... I keep a global object on $rootScope or in a service that contains my global url prams. Then you use that object from local or rootScope to populate all of your ui-srefs. So instead of doing this
This also makes it so when you change one of the values inside your urlPramas your ui-srefs are updated to link to the correct place. Without this when you change that urlParams object, ui-srefs simple ignore your changes until new DOM elements are loaded with new srefs. |
So I don't necessarily disagree that you should not be able to use the
|
So thats great in most cases. In fact its really nice not having to worry about passing your urlParams in most cases. However this is a large application with some robust needs. My problem is I have 2 different state sets. Also I have a settings area that there is no place for url params in the URL (a third state set). Thats on purpose to avoid mixing state info. Also that settings page changes parts of the current url params objects. So I need to keep my url params for different states in a separate location. |
This seems fine to me, but it looks like it needs to be rebased and cleaned up a bit. Also, there's already a |
90d6c5d
to
b5f7b59
Compare
Rebased and moved the tests am I missing anything? |
fix(ui-sref): Allow sref state options to take a scope object
Nope, merged. |
The tests pretty well outline the problem. Look at them if you want to see what is accomplished.
Basically when you try to use an object on a scope as your parameters for ui-sref. On a digest churn no updates occur. This fixes that problem.