angular.js - $scope.$on has no effect
PHP中文网
PHP中文网 2017-05-15 17:12:38
0
2
529
$scope.$on('$stateChangeSuccess', $scope.doRefresh);

这个函数不起效果,我计划想进入当前页面自动刷新,但是只有第一次点击进入页面才可以执行这个函数,再次点击就不进入了,求解。
PHP中文网
PHP中文网

认证高级PHP讲师

reply all(2)
左手右手慢动作

I found a solution, I even tried setting
<ion-view title="XXX" cache-view="false"> here to no avail

It only works if the cache is set to false in the route:

.state('receipt', {
                url: '/receipt',
                cache:'false',
                templateUrl: 'areas/receipt/receipt.html',
                controller: "ReceiptCtrl"
            })
            
            这样就可以解决了
世界只因有你

Inject $rootScope and use $rootScope to monitor

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template