Capturing error data in $ stateChangeError AND $ stateNotFound

I am trying to tweak some ui-router related angular errors

I am not receiving events for $ rootScope. $ on ('$ stateChangeError' ...) - or $ stateNotFound.

app.run(....)
    $rootScope.$on('$stateNotFound',
      function(event, unfoundState, fromState, fromParams){
        console.log(unfoundState.to);
        console.log(unfoundState.toParams);
        console.log(unfoundState.options);
      })

      

The odd thing is that I can get events for $ stateChangeStart && & $ ViewContentLoaded.

I expect this to happen when going from / page to / page / fake where fake hasn't defined state

I am not setting default handling using otherwise ()

+3


source to share





All Articles