Labels

Learn the powerful enterprise adaptable database:

Getting Started With ADABAS & Natural

Tuesday, January 3, 2017

IONIC Framework Lifecycle


$scope.$on('$ionicView.loaded', function(){
  // At this point, the view is loaded into the DOM. This event will only happen once per view being created.
});


$scope.$on('$ionicView.enter', function(){
  // At this point, a view is active. This event will trigger, no matter it was the first load or a cached view.
});


$scope.$on('$ionicView.leave', function(){
  // At this point, a view is no longer active. This event will trigger, no matter if it was the first load or a cached view.
});



$scope.$on('$ionicView.beforeEnter', function(){
  // This event will trigger when the view is about to enter and become the active view.
});


$scope.$on('$ionicView.afterEnter', function(){
  // This event will trigger when the view has fully entered and is now the active view.
});


$scope.$on('$ionicView.beforeLeave', function(){
  // This event will trigger when the view is about to leave and no longer be the active view.
});

$scope.$on('$ionicView.afterLeave', function(){
  // This event will trigger when the view has finished leaving and is no longer the active view.
});


$scope.$on('$ionicView.unloaded', function(){
  // The view’s controller has been destroyed including its DOM elements.
});


FIRST TIME VIEW INITIALIZATION
View 1 – loaded
View 1 – beforeEnter
View 1 – enter
View 1 – afterEnter

TRANSITION FROM ONE VIEW TO ANOTHER
View 2 – loaded
View 2 – beforeEnter
View 1 – beforeLeave
View 2 – enter
View 1 – leave
View 2 – afterEnter
View 1 – afterLeave

REFERENCE:
http://www.gajotres.net/understanding-ionic-view-lifecycle/

No comments:

Post a Comment