now I have a scene :
When user click go to last page , I want restore last page status .
I should konw the page is back , how can i know this information.
How to do this ?
Thanks for your help.
now I have a scene :
When user click go to last page , I want restore last page status .
I should konw the page is back , how can i know this information.
How to do this ?
Thanks for your help.
You can listen to $stateChangeSuccess (or any other $state event) and save the fromState
$rootScope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams, error){
$rootScope.lastState = { state: fromState, params: fromParams }
});
$rootScope.goBack = function() {
$state.go($rootScope.lastState.state, $rootScope.lastState.params); //Don forget inject $state into your controller
}
thanks , it works for me.
I your method to manage history my my self.