Ionic Tab not move to its position after back from single page


#1

this is Ionic version 1 question:

i have 4 tabs, each of the tab have it’s content, one of them have a list inside it…

so if we have a list inside 3rd tab, then we choose the list and go to single page with back button…

after i tab the back button, it back to 1st tab, not to 3rd tab…

it seems that it cannot remember the position by default, i have tried some workaround like this…

i set the tab just before it enter the previous page:

$scope.$on("$ionicView.beforeEnter", function (event, data) {
   $ionicTabsDelegate.select($scope.maintabindex);
});

with this on-select on each tab:

<ion-tab title="Forum" icon-on="ion-tab-fa-headphones" icon-off="ion-tab-fa-headphones" on-select="tabSelected()" href="#/app/home">

and then i have this function:

$scope.tabSelected = function () {
  $scope.maintabindex = $ionicTabsDelegate.selectedIndex();
};

the problem is, the on-select method executed after i back to the parent page (*with tab page), so it cannot working well, because $ionicTabsDelegate.selectedIndex() on-select always give 0 index after i back from the single page to the tabbed page

any idea?