I’m having a hard time using the SideMenu with the $stateProvider.
In your demo it transitions between each SideMenu-Item (adding a back button to each view), but that should not happen. Each SideMenu-Item should have it’s own view and history, just like the tabs directive.
I’m using $routeProvider for each page. But now, there is no transition between sub-pages (animate=“slide-left-right”) like going from /#/user to /#/user/tom. But here I want the transition to happen.
Is there a fast/easy solution for this? Cause I’m really stuck here.
Unfortunately, this doesn’t help. My index.html already looks like that. How do I make it that each side menu item got it’s own stack? I don’t get it.
index.html
<!-- The nav bar that will be updated as we navigate -->
<nav-bar animation="nav-title-slide-ios7"
type="bar-light"
align-title="center"
back-button-type="button-icon"
back-button-icon="ion-arrow-left-c"></nav-bar>
<!-- where the content of each page will be rendered -->
<nav-view></nav-view>
</pane>
<!-- Left Side Menu -->
<side-menu side="left">
<header class="bar bar-header bar-positive">
<h1 class="title">Menu</h1>
</header>
<content has-header="true">
<ul class="list">
<a href="{{item.link}}" ng-click="toggleLeft()" class="item item-icon-left" ng-repeat="item in list">
<i class='icon' ng-class="item.iconClass"></i>
{{item.text}}
</a>
</ul>
</content>
</side-menu>
</side-menus>
</div>
The only thing the ion-tabs directive do for navigation is listening for ui-router’s $stateChangeSuccess event and loads the appropriate tab and history into the view. This means you can change the state wherever you see fit (for example in your side menu) either using $state.go( “somewhere” ) or by changing the url using href.
To remove the tabs bar from the bottom of the screen, simply add display:none to the .tabs class.
Actually, I was wrong in my comment above. To keep track of history within the views you need to add the following code to the ionTabNav directive’s compile function: