So, I have this function for handling routing errors:
angular.module('player-tracker').run(['$rootScope', '$location', function($rootScope, $state) {
$rootScope.$on('$stateChangeError', function(event, toState, toParams, fromState, fromParams, rejection) {
if (rejection === 'AUTH_REQUIRED') {
$state.go("/home");
}
});
}]);
Not super complex, I know.
But whenever I run it, I get the issue that the $state.go method is coming back as undefined. Am I missing something?