Side menu behaves like tabs


#1

Hi,
I made a complete example of how to implement a side menu which behaves like a tabs bar. (So each side menu item has its own history stack)

http://cdpn.io/hcykA

Comments are welcome ! :slight_smile:


Make SideMenu behave like Tabs
#2

Unfortunately the nested view isn’t working. Go one step into the nested view, select another “tab” and then go back and you’ll see you’re back at the root. As far as I can find, there’s no way around this but to add some logic to ionic. I added the following to the ionTabNav directive’s compile function:

    $scope.$on( "tab.select", function(event, tab) {
      if($scope.title === tab) {
        $scope.selectTab(event);
      }
    });

As You can see I’ve introduced an event called “tab.select” which can be broadcast on $rootScope. You simply send the title of the tab you’d like to show.

Hope it works!