Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
AngularJS

Promises in AngularJS

Chain async work with .then / .catch style promise APIs.

Promises in AngularJS — a practical guide to AngularJS promises with clear examples you can reuse in real projects.

AngularJS Tutorial Series (68/99). Prefer one article? Read the complete AngularJS tutorial.

Short description

$http returns promises; compose them instead of nesting callbacks.

Promise tip

ItemService.list()
  .then(function (items) { vm.items = items; return items[0]; })
  .then(function (first) { return ItemService.get(first.id); });

Leave a reply

Your email address will not be published. Required fields are marked *