I am working on a route resolve that includes the following functions:
resolve: {
user: function($route, User){
return User.find($route.current.params.id);
},
stats: function($route, Stats) {
/* asynchronous stat retrieval based on the 'user' object obtained in the previous function */
var user = ... obtained from earlier function ...
return Stats.load(user.email);
}
}
Is there a way to access the retrieved user from the 'user' function inside the 'stats' function without involving the controller and keeping everything within the resolve?
Appreciate any insights!