Navigate to certain tab on back navigation instead of first


Hello, How to override “back” navigation button. I am having 5 tabs inside my page1. I click on second tab which opens a different page…say Page2. When i can click on back, app is taking me to page1->tab1.

I want to open Page1->tab2. how can i do this.


It’s kind of tough to visualize what you talking about, could you throw together a codepen?

But if you need to override the back button with a custom function, use this.

        var deregister = $ionicPlatform.registerBackButtonAction(
                function () {
                    alert("Show on the home page")
                }, 100
        $scope.$on('$destroy', deregister)