$state.go with {reload: true} messes with $ionicHistory.goBack()


#1

I’m trying to navigate from the state app.profile.id with parameter {id: x} to the state app.profile.id with parameter {id: y}. I do it by $state.go('app.profile.id', {id: y}, {reload: true}) When I console.log the history stack, everything seems right (current view is state with y and back view is the state with x). The back button appears however the transition to the back view doesn’t happen. When I hit the back button and manually refresh the data (I have pull down to refresh implemented), the data seems to be changed to x. Also, when I hit the back button one more time, this time nothing happens at all, the goBack() completely breaks. I have cache enabled.


#2

I have the same problem. The only solution is not to add {reload:true} but … I need to reload the page!!

Any help?

Massimo


#3

11 days passed, still couldn’t resolve this issue…


#4

I think I found a solution: try to insert your $state.go inside a $ionicHistory.clearCache():

$ionicHistory.clearCache().then(function(){
$state.go(‘app.home’, {}, {reload: true});
});

Massimo


#5

try setting the replace option to reload the current page replacing the old reload entry.

$state.go(xxx; params, {
  reload: true,
  location: 'replace'
});