Let\'s say I have 4 routes - 2 require the user to be logged in, 2 do not. My app init looks like:
$routeProvider.when(\'/open1\',{templateUrl:\'/open1.h
I had the same problem and I did it this way:
var app = angular.module('myModule',["ui-bootstrap"]);
And then listen for a locationchange in the app (this will also trigger onEnter of a page)
app.run(function ($rootScope, $location, $cookieStore) {
$rootScope.$on("$locationChangeStart", function (event, next, current) {
//Here you can check whatever you want (servercall, cookie...)
});
}
I Hope this helps!