I see this topic but this solution not solve my problem.
Angularjs ui-router abstract state with resolve
I want to describe my problem shortly.
I have to state one of them is abstract (parent) two of them have resolve. two resolve make http but child state dont wait parent resolve result. how child resolve wait parent state resolve
Firstly go parent state it's ok , then go child state but child state dont wait parent http result
My plan something like this. In all state (for page refresh) i check user cookie if exist load user again (make http call)
All child state use this user information and get related data for user.
So i need to first of all complete abstract resolve http call.
.state('app', {
url: '/app',
abstract: true,
templateUrl: Route.base('app.html'),
resolve: {
userExist: ['api', function (api) {
var currentUser = cacheService.getUser();
api.loginExistUser(currentUser).then(function (result) {
api.setUser(result.data, true);
});
}]
}
})
.state('app.myFriends', {
url: '/myLingpals',
templateUrl: "myFriends.html",
controller: "myFriendsController",
controllerAs: "vm",
resolve: {
myFriends: ['api' function (api) {
return api.get("myfriends");
}]
}
})