I know that angular has a function $stateChangeStart , which can perform actions as follows.
$rootScope.$on('$stateChangeStart', function (event, toState, toParams, fromState, fromParams) { });
However, I am developing an ionic v1 application in which I would like to use a more intuitive way, which is the ionic life cycle. I am wondering if it is possible to get toState and toParams in $ionicView.beforeLeave since I cannot find the documentation on this. eg:
$rootScope.$on('$ionicView.beforeLeave', function (event, toState, toParams) { });
source share