Last active
November 10, 2015 06:23
-
-
Save YashdalfTheGray/f1b0df02f989beedb406 to your computer and use it in GitHub Desktop.
Waiting for multiple resolutions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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