1

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();
});
chrki
  • 6,143
  • 6
  • 35
  • 55
Lior Ohana
  • 3,467
  • 4
  • 34
  • 49

0 Answers0