Go back to root navigation page $ionicNavBarDelegate


#1

Hi *,

i’m using ion-nav-bar and i need to go back at the root page of my navigation.
Example:

I have Page1->Page2->Page3->Page4 now in Page4 i need i button to go back at Page1.
Please any suggests?

I know that i can use $state.go(page1) but it isn’t the right behavior that i need, because i will have:
Page1->Page2->Page3->Page4->Page1

Thanks in advance


#2

I don’t understand what you’re asking. Why is it the wrong behavior to go from Page 4 to Page 1?

If you’re talking about the transition animation, you can use navDirection (on the nightly build) in order to appear like you are going backwards.


#3

try this:

$ionicHistory.goToHistoryRoot($ionicHistory.currentView().historyId)

It’s work on 1.0.0-beta.14. Because of $ionicHistory ship in this version.