I need to execute something only after a multiple of AJAX calls got their response so I'm using $q.all to wait until all promises were
var promises = myServices.map(function (service) {
return $http.get(service.url);
});
$q.all(promises)
.then(function(data) {
doAll();
});
For some reason, doAll
is never called. However, if I do the following it works fine:
$q.all([$http.get(serviceA.url), $http.get(serviceB.url)])
.then(function(data) {
doAll();
});