Angular $q returning promise multiple $http calls
问题 I'm working on an $http call that loops over each of multiple api's and returns all of the data in one object. I usually have the promise ready to resolve when the $http call has been made. Similar to this: function getAllData(api) { return $http({ method: 'GET', url: '/api/' + api }) .then(sendResponseData) .catch (sendGetVolunteerError); } The current function I have loops over each api and pushes each object in the api into an array and then pushes it into an overall array. I had this