-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
Description
I'm trying to capture the error, but they're not getting it.
code in my route:
resolve: { login: function($q, $auth) { if ($auth.isAuthenticated()) { return true; } else { var errorObject = { code: 'NOT_AUTHENTICATED' }; return $q.reject(errorObject); } } }
code no .run:
`$rootScope.$on('$stateChangeError', function(event, toState, toParams, fromState, fromParams, error) {
event.preventDefault()
$timeout(function() {
$state.go('app.auth_entrar');
console.log(event, toState, toParams, fromState, fromParams, error);
});
})`
where I should receive the error that I created, I get an error from angularjs, where am I wrong ??