Using Angularjs and UI-Router, trying to run a function with every state change
$rootScope.$on('$stateChangeStart', function(toState){ if(toState !== 'login') UsersService.redirect(); })
I put this in .run () and I can successfully log out of toState every time the route changes. However, I cannot find a property that has the name of the state that we are going to make. If someone tells me where to find it, I think I should be in good shape.
angularjs angular-ui-router
user2827377
source share