Page redirect, which prevents $ionicView.afterEnter triggering


When the user views the home page, i’d like to redirect immediately to the introduction page given a certain flag.
The problem is, the “afterEnter” is triggering on the home page despite the introduction page now being visible.

I would like to redirect from home to intro while prevent afterEnter triggering on home.

For an example home page:

$scope.$on('$ionicView.beforeEnter', function () {
   if (goIntro) {
   } else {

$scope.$on('$ionicView.afterEnter', function () {
   console.log("I should not happen! if goIntro == true");
   // I do not want the one-off animation to occur while the intro page is viewed
   // Therefore i do not want this to happen, until we navigate to home after doing the intro


I found
but not sure if it can help in my case. Any hints?

if (boolean) { toToPage} else {continue with current page}


Ended up using:

$rootScope.$on("$locationChangeStart", function (event, next, current) {
                if ($location.path() == '/home') {
                    if (goIntro) {