+1 on this. I have a similar app, back works fine when moving from detail back to master, but $ionicHistory.backView()
is always null
when moving from one master view (those in the sidemenu) to the other. Help @mhartington
UPDATE
There's a fix in this stackoverflow post.
Basically the menu-close
directive on menu items also resets the history stack.
use this directive instead:
myModule.directive('menuCloseKeepHistory', ['$ionicHistory', function($ionicHistory) {
return {
restrict: 'AC',
link: function($scope, $element) {
$element.bind('click', function() {
var sideMenuCtrl = $element.inheritedData('$ionSideMenusController');
if (sideMenuCtrl) {
$ionicHistory.nextViewOptions({
historyRoot: false,
disableAnimate: true,
expire: 300
});
sideMenuCtrl.close();
}
});
}
};
}]);
Works like a charm.