I read this very well though out post
What "things" can be injected into others in Angular.js?
and was curious since I've been told the use the resolve property to make xhr's and to use services to help with these calls. How does the resolve property in this code work? At what point is the $injector invoked?
app.config(function($stateProvider){
$stateProvider
.state("eventIndex", {
url: "/events",
views: {
"main": {
controller: "EventsCtrl",
templateUrl: "assets/events/index.html"
}
},
resolve: {
events: ['EventService', function(Event){
return Event.allEvents()
}
]
}
});
});