$ionicHistory.goBack() not working properly


#1

Hi,

$ionicHistory.goBack() is taking two views behind the current view in sidemenu app.

ex: view1 -> view2 -> view3

if I call $ionicHistory.goBack() from view3 its routing to view1 instead of view2


#2

hi @ravikiran6763

you can use for back to your history :

window.history.back();

thasnks


#3

thanks for the reply

even window.history.back(); is behaving the same


#4

you can pass

window.history.go(-2);


#5

I have tried all the ways with window.history and $ionicHistory.goBack() but still stuck at the same issue

Thanks


#6

window.history.back(-1);
$scope.backView = $ionicHistory.backView();
$scope.backView.go();
$ionicHistory.goBack();
$ionicHistory.goBack(-1);

I have tried all these methods already


#7

check below example :


#8

I am facing the same issue as explained HERE . but the solution did not work for me unfortunately.


#9

could you print here your issue

thanks