Nav button to go back to tab root?


#1

Consider the standard tab + navigation behavior, as shown in this CodePen.

If you navigate to /tab/facts2 in the Home tab (nav-view), and then click the About tab, and then click the Home tab, you see facts2.

How can I change the behavior so that, when you switch to the Home view, you start at /tab/home again (and lose your history)?


#2

Did you ever solve this? : )


#3

here is an implementation that solved this


#4

It didn’t really solve the problem, because it doesnt loose the history?


#5

If anyone is still looking for a solution for this, you have to use the nextViewOptions of the $ionicHistory Service by setting the option historyRoot to true:

$ionicHistory.nextViewOptions({
    historyRoot: true
});

This will set the next view as the history root.