HTML
<div id="loading" ng-controller="LoadingCtrl" ng-show="isViewLoading">Loading</div>
JS
app.controller('LoadingCtrl', function($scope){
$scope.isViewLoading = false;
$scope.$on('$routeChangeStart', function() {
$scope.isViewLoading = true;
});
$scope.$on('$routeChangeSuccess', function() {
$scope.isViewLoading = false;
});
});
加载div仅在我第一次调用某条路线时显示。如果我再次呼叫此路线,则不显示div。怎么了?
编辑:当我第二次调用某个路径时,它会停止更新isViewLoading变量