声明:本篇文章实在我学习过程转载别人的,由于自己的不细心,忘了转载的原地址,希望原作者原谅,如有冒犯请尽快联系我删除。写的非常好

 
Ionic 中$ionicView.beforeEnter(页面刚加载)  $ionicView.afterEnter  (页面加 载完成) $destroy(页面销毁) 广播事件 

//ionic controller刚加载执行的广播通知方法
  1. $scope.$on('$ionicView.beforeEnter', function() {  
  2.             
  3.   console.log('beforeEnter'); 
  4. });   
复制代码


//ionic controller全部加载完成 执行的广播通知方法 (数据全部请求完成)

  1. $scope.$on('$ionicView.afterEnter', function() {  
  2.                 console.log('afterEnter');  
  3. }, false);  
复制代码



//ionic controller全页面销毁 执行的广播通知方法 

  1. $scope.$on('$destroy',function(){            
  2. console.log('$destroy');           
  3.   $rootScope.hideTabs = ' ';
  4. })   
复制代码

 

posted on 2015-09-29 16:16  AmeliaLi  阅读(450)  评论(0编辑  收藏  举报