我目前正在我们的主页面上使用自定义加载指令实现一个加载页面,在$ stateChangeStart事件被触发后切换为true,并在$ stateChangeSuccess事件之后切换为false。但是,每当我从子状态导航到其父状态时,都不会触发$ stateChangeSuccess事件。代码示例如下:
var stateStart = $rootScope.$on('$stateChangeStart', function (event, toState, toParams, fromState) {
timeout = $timeout(function () {
$ionicNavBarDelegate.title(findTitle(toState.name));
$rootScope.loadingState = true;
}, 50);
});
var stateFinish = $rootScope.$on('$stateChangeSuccess', function (event, toState, toParams) {
$timeout.cancel(timeout);
$rootScope.loadingState = false;
});