I would like to resolve the promise that loads the current user for all the pages of my application.
Currently I repeat the resolve in every $routeProvider.when()
Both @N13 and I could not make @Josh's solution work. But this did work for me:
module.config(['$routeProvider', function($routeProvider){
$routeProvider.accessWhen = function(path, route){
route.resolve || (route.resolve = {});
route.resolve.language = "something"
return $routeProvider.when(path, route);
};
}]);
use with:
$routeProvider
.accessWhen('/login', {
...
});