Hi John,
you mean you want to do something like this?
app.run([
'$location', '$rootScope',
function ($location, $rootScope) {
$rootScope.on('$routeChangeStart', function () {
if (checkForLogin()) {
$location.path('/gotoLogin');
}
});
}
]);
It work as follows, if a new route is being called, the route Provider will
send out the event. This code intercepts this event, checks if it needs a
login (you have to provide this code) and redirects when needed.
I typed this up in the browser, so there might be some syntax issues with
it, but it should get you started.
Does this work for you?
Regards
Sander
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.