I have two queries on resources and try to process the data once both 
queries have been finished. I tried to do this with the following code:

var groupRes = $resource(baseUrl + "group/" + ":Id", { Id: "@Id" }, {});
var group = groupRes.query();
var taskRes = $resource(baseUrl + "task/" + ":Id", { Id: "@Id" }, {});
var task = taskRes.query();

var r, e;
$q.all([group.$promise, task.$promise]).then(function (results) { r = 
results;
}, function (error) { e = error;
});

However, neither of my two functions for $q.all(..).then(...) are being 
called and both r and e stay undefined.

When I do a 'then' on just one of the promises everything works as 
expected. 

task.$promise.then(function (result) { ....

How can I get this to work with $q.all?

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to