I wanted to know if there is a way in Angular to refresh a single page application and properly go back to the same state as before? I am using ui-router
(version 0.2.15) for defining different states.
Currently, I am storing the state name using ngStorage
and have placed $state.go(last_stored_state_name)
in the controller of the state that loads first. This way I get to the state that i was on before refresh but the problem is i can see the first state's view just for a second before $state.go(last_stored_state_name)
runs.
Can anyone please tell me how I can bypass the first state's view directly to the desired state?