Skip to content

Instantly share code, notes, and snippets.

@YashdalfTheGray
Last active November 10, 2015 06:23
Show Gist options
  • Save YashdalfTheGray/f1b0df02f989beedb406 to your computer and use it in GitHub Desktop.
Save YashdalfTheGray/f1b0df02f989beedb406 to your computer and use it in GitHub Desktop.
Waiting for multiple resolutions
$q.all([
server.getFollowersList(),
server.getFollowingList(),
server.getTweets(),
server.getUserDescription()
]).then(function(result) {
// The result object will be an array
// with all of the results.
ctrl.updateFollowers(result[0]);
ctrl.updateFollowing(result[1]);
ctrl.showTweets(result[2]);
ctrl.updateDescription(result[3]);
}).catch(function(error) {
// this runs when anything errors or
// gets rejected.
console.log(error);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment