Skip to content

Instantly share code, notes, and snippets.

@0xBADC0FFEE
Created January 20, 2014 15:26
Show Gist options
  • Save 0xBADC0FFEE/8521915 to your computer and use it in GitHub Desktop.
Save 0xBADC0FFEE/8521915 to your computer and use it in GitHub Desktop.
var promise = $q.all(null);
angular.forEach(urls, function(url){
promise = promise.then(function(){
return $http({
method: 'GET',
url:url
}).then(function(res){
$scope.responses.push(res.data);
});
});
});
promise.then(function(){
//This is run after all of your HTTP requests are done
$scope.doneLoading = true;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment