Promises are a tactic for deferred computing, suitable for several styles of concurrency: thread and event loop concurrency for local computation, and both synchronous and asynchronous remote messaging. A promise represents the eventual result of an asynchronous operation. The primary way of working with promises is through a method which registers callbacks to receive the promise's eventual value or the reason why the promise cannot be fulfilled.
- Stackoverflow.com Wiki
Promises capture the notion of an eventual value into an object.
The idea is simple enough – you want to create a service that captures the data and stores is and then notify the controller that the data has changed or refreshed. Let’s look at a few different approaches to help us understand how the $http service works with its custom promises.
This blog post gives tips for error handling in asynchronous, Promise-based functions.