How to use shouldChangeHistory in $ionicTabsDelegate?


#1

one of my page structure is like this:

<ion-view title="MainHome">
        <ion-tabs>
            <ion-tab>
                <ion-nav-view>
                    <ion-content>
                           This is Home 1
                    </ion-content>
                </ion-nav-view>
            </ion-tab>
            <ion-tab>
                <ion-nav-view>
                    <ion-content>
                           This is Home 2
                    </ion-content>
                </ion-nav-view>
            </ion-tab>
        </ion-tabs>
</ion-view>

and i navigate them using $ionicTabsDelegate.select(0, true); & $ionicTabsDelegate.select(1, true);

The navigation works properly but the history is not reserved, for example, when I’m at Home2 tab and then navigate to another page from Home2, and click the ‘back’ button, it goes back to the “MainHome” default (i.e. Home1 tab) instead of Home2 tab, and I want it back to the tab before redirection instead of default. Thank you.


#2

Taken right from the doc,


#3

i mean when i set to ‘true’, the history still cannot be saved


#4

are they related? - Loss of transition and back button from tab view


#5

Works for me in this example.

Go to the second fact, the to the about tab, then nav-stack