声明:本篇文章实在我学习过程转载别人的,由于自己的不细心,忘了转载的原地址,希望原作者原谅,如有冒犯请尽快联系我删除。写的非常好
Ionic 中$ionicView.beforeEnter(页面刚加载) $ionicView.afterEnter (页面加 载完成) $destroy(页面销毁) 广播事件
//ionic controller刚加载执行的广播通知方法
- $scope.$on('$ionicView.beforeEnter', function() {
-
- console.log('beforeEnter');
- });
复制代码
//ionic controller全部加载完成 执行的广播通知方法 (数据全部请求完成)
- $scope.$on('$ionicView.afterEnter', function() {
- console.log('afterEnter');
- }, false);
复制代码
//ionic controller全页面销毁 执行的广播通知方法
- $scope.$on('$destroy',function(){
- console.log('$destroy');
- $rootScope.hideTabs = ' ';
- })
复制代码
|