-
Notifications
You must be signed in to change notification settings - Fork 3k
$stateChangeSuccess fires when url still has the previous state in it. #1151
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
Comments
Use the |
I would like to reopen this issue as I can't use any angular related thing in the component I'm using. |
I ran into this issue because my controller wants to save data to I thought perhaps I could listen to this event, but it seems that the event fires even before the controller is run. I had the choice of either using |
UI-Router Question
Inside of $stateChangeSuccess, the current window.location.hash is still the previous state. This is not what I expect (since I'm in the success handler). Is this known? Is it a mindful decision?
Background (you can ignore this if you like)
I need to force a real, complete page refresh in some situations to relieve pressure from built-up memory leaks.
An approach to do this is to watch the state changes, and do a full page refresh every 100th or so.
$state.reload()
doesn't do a full reload. Neither does$state.go($state.current, null, {reload: true})
. Neither doeswindow.location.reload(false)
(it's supposed to skip the cache, but actually doesn't re-parse the JS, which is a shame).So, I'm using
window.location.reload(true)
to force a refresh. This uses the value ofwindow.location
at the time, so using$stateChangeSuccess
requires thissetTimeout
.The text was updated successfully, but these errors were encountered: