-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
Description
I see you've go an onEnter callback. I'd like to request something similar, but at the global level, so all state transitions need to pass the before filters before processing the route.
The main use case I'm thinking about are
- login-checked
- has the user completed signup check
I was just sketching out my own ideas for this before googling to find this router project (looks great, can't wait for it) which would look something like this in my head... (obv not using $routeProvider, but you get the point)
$routeProvider
.before(function($route) {
if($route.current.secure && !$rootScope.currentUser) {
// abort the current route
// force login here
}
})
Any appetite for including this sort of functionality within your router project?
I think the big difference over onEnter is the ability to abort routes, and do it on all states