Back button respecting location:replace


#1

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.


#2

Same Here T_T. Please help


#3

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


#4

Sorry but i have to say:
“push”


#5

There is an issue opened on github about it: https://github.com/driftyco/ionic/issues/1287


#6

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');


#7

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 ;).


#8

That’s the ideal scenario, but while this happens it’s a good workaround. I’m using it and works perfectly.


#9

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