I have a fairly standard AngularJS app running in Ionic using Ionic's tabs. The state controller looks like you'd expect:
$stateProvider.state('login', {
url: '/login',
templateUrl: 'templates/login.html',
controller: 'LoginCtrl'
})
// abstract state for the tabs directive
.state('tab', {
url: '/tab',
abstract: true,
templateUrl: 'templates/tabs.html'
})
.state('tab.selector', {
url: '/selector',
views: {
'tab-selector': {
templateUrl: 'templates/tab-selector.html',
controller: 'SelectorCtrl'
}
}
})
...
I then call a modal to play video files using boilerplate modal code:
$ionicModal.fromTemplateUrl('play-modal.html', {
scope: $scope,
animation: 'slide-in-up'
}).then(function (modal) {
$scope.modal = modal;
});
This all works well. The problem comes when I use Android's back button. The modal closes nicely, but the state also backs up a level. This is what I'd like to prevent. I'm hoping that there's something less heavy-handed that preventDefault()
available through Ionic.