I found an undesired behaviour with the ionic tabs.
Basically i have some tabs, in the first tab i have 3 views, one leading to another with the tab1Initial giving access to the tab1internal1 view, and this one giving access to the tab1internal2 view in the same tab, no problem there.
But i have other tab (let's call it second tab) that leads to tab1internal2 in the first tab, which works as expected, except for one detail:
If i haven't visited the first tab, and access tab1internal2 view from the second tab to the first tab, this tab1internal2 view remains as the default view of the first tab, which should show the tab1Initial view when touched but instead shows tab1internal2, as if the first view shown by a tab is the one that tab sticks with, and that is exactly my problem.
I have a codepen showing this behaviour, https://codepen.io/Orion390/pen/yajLKa , the InternalPages tab is the first tab i'm talking about, the About tab access the internal2 view in the InternalPages tab with that button, it's easy to replicate the behaviour i explained.
Btw, i am not worried by the navigation, my issue is only the tab not showing the view i need when i touch it.
Shouldn't this
<ion-tab title="InternalPages" icon="ion-home" href="#/tab/home">
<ion-nav-view name="home-tab"></ion-nav-view>
</ion-tab>
Assign that view as the default, no matter how you navigate?
I have a simple workaround, consists in putting ng-click="onTabSelected()" in the tab, and in the controller assigned to the tabs:
$scope.onTabSelected = function () {
$state.go("tab.home");
}
That way, always the tab is touched it will lead to the state i want, not the first shown or whatever, i hope it's useful for someone, the behaviour that gave the problem really looks like a bug in ionic.