This seems like a bug but it may be intentional. When I go to a view using
$state.go('blah', {}, {location: 'replace'})
It correctly changes the browser’s back button so that the page will be skipped over. But
$ionicNavBarDelegate.back()
does not respect this. It just acts as if the location:‘replace’ wasn’t specified.
ericff
June 2, 2014, 10:40am
2
Same Here T_T. Please help
I’ve got the same issue…
Maybe somebody from ionic team can say a few words?
And i won’t manipulate ionic view states…
Thanks and greets,
bengtler
Sorry but i have to say:
“push”
There is an issue opened on github about it: https://github.com/driftyco/ionic/issues/1287
Hi again, after some interesting reading of the ionic code, specifically the $ionicViewService
I found this solution, replace the currentView with the backView, that it’s exactly location replace does:
$rootScope.$viewHistory.currentView = $rootScope.$viewHistory.backView; $state.go('bla');
I know that service very well, but this is an undocumented part, because you can break many things with that.
So ionic should respect this issue by default ;).
That’s the ideal scenario, but while this happens it’s a good workaround. I’m using it and works perfectly.
This doesn’t work in 1.0.0 correctly, here’s a fix I’m trying to get in https://github.com/driftyco/ionic/issues/3750