Guys I had the same problem and spent several hours. But the solution is very simple! I found it by invastigating "robinyo"s’ link for the starter template.
Just use this in your menu.html for defining your side menu:
<ion-side-menus enable-menu-with-back-views="false">
See: ion-side-menus - Directive in module ionic - Ionic Framework
From the docs:
Determines whether the side menu is enabled when the
back button is showing. When set to false, any menuToggle will be hidden,
and the user cannot swipe to open the menu. When going back to the root page of the side menu (the
page without a back button visible), then any menuToggle buttons will show again, and menus will be
enabled again.
For defining your menu left button (in menu.html) use the menu-toggle attribute:
<ion-nav-buttons side="left">
<button class="button button-icon icon ion-navicon" menu-toggle="primary"></button>
</ion-nav-buttons>
Now the back button hides when the menu icon should be displayed!
Hope this helps some guys!
Edit: Just to be sure here is my menu.html. It’s important to define the back button here:
<ion-side-menus enable-menu-with-back-views="false">
<!-- Center content of App -->
<ion-side-menu-content>
<ion-nav-bar class="bar-positive">
<ion-nav-back-button>
</ion-nav-back-button>
<ion-nav-buttons side="left">
<button class="button button-icon icon ion-navicon" menu-toggle="primary"></button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-nav-view name="menuContent" class="no-animation"></ion-nav-view>
</ion-side-menu-content>
</ion-side-menus>
Edit 2:
Another important thing is that I had to use:
ui-sref="app.tab2"
For my ion-items!
With my own click-event and the $state.go advice it always created the wrong back functionality (only the first tab view had the left button, the other main menues had only a back button!)
Edit 3:
The $state.go statement is working if you use right before:
this.$ionicHistory.nextViewOptions({
disableBack: true
});