-
Notifications
You must be signed in to change notification settings - Fork 3k
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
$state.go to current state reloads controller with notify set to false (broken by 0.2.11) #1387
Comments
Any update on this? How should I reload a state with new parameters without reloading the controller? |
Okay, seems like that should be based on the |
@christopherthielen @mafredri @nateabele $state.go('stateA', {param: newvalue}, notify: false); any other command like: $state.go('stateB'); or $state.go('stateA.substate'); reload controller.
|
Not working for me as well. |
What are you trying to accomplish by setting notify to false? |
I'm trying to update the parameters of the current state, in order to update the url |
I have same use case - I need to reflect state of app to url (in my case they are current page of pagination and search query string). But this bugs prevent update without page reloading. |
What version are you using? This is still working for us in |
@mafredri btw you have Perast and island Gospa, Montenegro at your avatar - I'm living near there :). Sorry about offtopic |
@hyzhak yea looks like you have a valid bug in your issue, but it looks unrelated to this one. Also, cool, I was just touristing there, but nice spot! :) |
Any workaround for this? It's holding me up as well. |
Also, for the record, I'm seeing this issue (reload original state on state change event after path has been updated via notify: false) on both 2.13 and 2.15. |
I just encountered this issue too (0.2.14). Had to settle on a combination of $location.search and reloadOnSearch: false to achieve what I needed to. |
I have the habe problem here, using v0.2.15. I have this
When I run $state.go() in a later context, then the entire "state tree", including the parents, are reloaded (view, controller, etc). The only way to work around that is using "reloadOnSearch: false" on the parent state. The problem is that I need to reload the parent state, in other contexts, so I can't set that for the entire state, but need to decide when not to reload the parent state, for ex using "notify: false". |
Test with $location.path(state); and $location.path().replace(); obviously using ui-router |
I'm unsure if this is the intended functionality, but commit 7b78ede breaks
$state.go($state.current.name, params, {notify: false});
$state.go can be called one time without reloading the controller, but the second time it is called the controller also gets reloaded, reverting the commit fixes the issue.
I created a plunkr for good measure to demonstrate the issue. http://plnkr.co/edit/jvuPlkcGmYNwhptUvcHY?p=preview
The text was updated successfully, but these errors were encountered: