Skip to content

Instantly share code, notes, and snippets.

@YashdalfTheGray
Last active November 9, 2015 02:57
Show Gist options
  • Save YashdalfTheGray/c5fd551f57642015f0e6 to your computer and use it in GitHub Desktop.
Save YashdalfTheGray/c5fd551f57642015f0e6 to your computer and use it in GitHub Desktop.
Handing Promises using .then()
var promise = $timeout(messageFunction, delay);
promise.then(function(result) {
ctrl.message = result;
});
// The call to then() can also be chained.
$timeout(messageFunction, delay).then(function(result) {
ctrl.message = result;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment