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() of my routes.
$routeProvider.when('/users/edit/:userId', {
templateUrl: 'app/app/assets/partials/user-edit.html',
controller: 'UserEditController',
resolve:{
'currentUser':function( UserService){
return UserService.getCurrentUser();
}
}
});
$routeProvider.when('/staff_profil/edit', {
templateUrl: 'app/app/assets/partials/profil-edit.html',
controller: 'ProfilEditController',
resolve:{
'currentUser':function( UserService){
return UserService.getCurrentUser();
}
}
});
My goal is to resolve my current user for all the routes without repetition.