I am getting stuck on something I think should be straight forward. I need to take data from three different ajax calls, combine and process all three, and display the resu
You can use $q's function 'all':
function giftControler ($scope, $http, $q) {
var names = $http.get("names.json"),
naughty = $http.get("naughty.json"),
nice = $http.get("nice.json");
$q.all([names, naughty,nice]).then(function(arrayOfResults) {
... This callback would be called when all promised would be resolved
});
This way is little bit cleaner.
Here is link to docementation: http://docs.angularjs.org/api/ng.$q