I am using Ionic v1.0.0-rc.2.
As controller + views are cached in Ionic, one has to take care to properly initialize the controller $scope.
I am using the following callback to do this:
$scope.$on('$ionicView.beforeEnter', function(){
...
}
However, to know how to initialize the $scope I need to know how the view was called:
- Was it called by a back button (A --> B --> back to A)
- in this case I want to leave most items as is
- Was it returned to after pressing a back button (A --> B --> back to A --> return to B)
- in this case I want to leave most items as is
- Was it entered following a new path (not back or forward) ... note that the the view may have already been instantiated from previous navigations
- in this case I want to re-initialize the view
I have been looking at the documentation below, but could not find a way of doing this, or what parameters, if any, are passed into the callback function. Any documentation pointers would be great.