I have an array of resources called companies
, and I run some query calls on another resource based on that, and then fire a callback. I tried the following, but the callback gets called straight away:
$q.all(companies.map(function(company) {
return Person.query({
companyId: company.id
});
})).then(function(people) {
// do stuff
});