After updating an existing Ionic project from 1.13-beta to 1.14-beta I\'ve experienced some behaviour I can\'t explain. When changing from one viewstate to another, the old
This is an open issue https://github.com/driftyco/ionic/issues/2869 and probably occurs when view-cache="false".
On my case $ionicView.leave
worked in nested views but not when moving between tabs nor did $ionicParentView.leave
so I came around it with another solution.
Solution: On MAIN controller I added:
$rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState, fromParams) {
if (fromState.name === 'name-of-leaving-state') {
//your code here, similar behavior with .$on('$ionicView.leave')
}
});
Hope it helps