Skip to content

Instantly share code, notes, and snippets.

@DevankAgarwal
Last active October 9, 2015 09:59
Show Gist options
  • Save DevankAgarwal/f22917ed6fd78612395c to your computer and use it in GitHub Desktop.
Save DevankAgarwal/f22917ed6fd78612395c to your computer and use it in GitHub Desktop.
Promise sync in angular.
$http.post(<serviceUrl>, json).then(function (res) {
return $q.when(res);
}).then(function (res) {
console.log(res);
return $q.when(res);
}).then(function (res) {
return res
}).then(function (res) {
defer.resolve(events);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment