How can I asynchronously call 3 independent API methods so that as soon as any one of them has completed, I can work with the response without waiting for the others to finish? I am looking for a solution similar to System.Threading.Tasks in C#.
var promise1 = $http.get("/api/city/boston");
promise1.success(function(name) {
console.log("Your city is: " + name);
});
var promise2 = $http.get("/api/city/newyork");
promise2.success(function(name) {
console.log("Your city is: " + name);
});
var promise3 = $http.get("/api/city/chicago");
promise3.success(function(name) {
console.log("Your city is: " + name);
});