If you do something like:
_dashboard.getGuideLocationDetails = function(guideLocations){
var promises = [];
var locationDetails = [];
angular.forEach(guideLocations, function(location){
if(location.placesRef){
promises.push(ngGPlacesAPI.placeDetails({reference:location.placesRef}).then(function(l){
locationDetails.push(l);
}));
}
});
return $q.all(promises).then(function(){
return locationDetails;
});
}
Where you are handling more then 10 refs, it just doesn't resolve.
If you do something like:
_dashboard.getGuideLocationDetails = function(guideLocations){ var promises = []; var locationDetails = []; angular.forEach(guideLocations, function(location){ if(location.placesRef){ promises.push(ngGPlacesAPI.placeDetails({reference:location.placesRef}).then(function(l){ locationDetails.push(l); })); } }); return $q.all(promises).then(function(){ return locationDetails; }); }Where you are handling more then 10 refs, it just doesn't resolve.