Last active
February 24, 2019 16:59
-
-
Save shivenigma/0892cf283799e45ffdfec611280b6227 to your computer and use it in GitHub Desktop.
to debug routing issues in angular 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ui-router debug code | |
* */ | |
/*$rootScope.$on('$stateChangeStart',function(event, toState, toParams, fromState, fromParams){ | |
console.log('$stateChangeStart to '+toState.to+'- fired when the transition begins. toState,toParams : \n',toState, toParams); | |
}); | |
$rootScope.$on('$stateChangeError',function(event, toState, toParams, fromState, fromParams){ | |
console.log('$stateChangeError - fired when an error occurs during transition.'); | |
console.log(arguments); | |
}); | |
$rootScope.$on('$stateChangeSuccess',function(event, toState, toParams, fromState, fromParams){ | |
console.log('$stateChangeSuccess to '+toState.name+'- fired once the state transition is complete.'); | |
}); | |
$rootScope.$on('$viewContentLoaded',function(event){ | |
console.log('$viewContentLoaded - fired after do\m rendered',event); | |
}); | |
$rootScope.$on('$stateNotFound',function(event, unfoundState, fromState, fromParams){ | |
console.log('$stateNotFound '+unfoundState.to+' - fired when a state cannot be found by its name.'); | |
console.log(unfoundState, fromState, fromParams); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment