How to changee nav direction in $state.go()


#1

I have implemented $stateProvider in my app. I want to load one view directly, and get back to home view with the back transition.

Eg:
Load View 3 while app launching, and move to View2 when clicking back key on the View3 header. Same as View2 to View1.

Here i’m using $state.go(‘statename’) to navigate the view, but $state.go() uses forward transition. Here i want back transition for the view navigation. How can i acheive this.

Anyone help me out, Thanks in advance.


#2

have you tried $state.goBack(-1) -1 being the number of pages it go’s back by

or check this link


#3

Thanks for your reply,

I tried this,
$ionicViewSwitcher.nextDirection(‘back’);
$state.go(‘myState’);

But, it wont help me out. It always moves with forward transition.