Ionic页面加载前 ionic页面加载完成 ionic页面销毁执行的事件

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. })   
原文地址:https://www.cnblogs.com/mili3/p/6164224.html