Observables

Observables, similar to promises, help handle asynchronous events in an application. The key differences between Observables and promises are:

  • Observables can handle multiple values over time, while promises are called once and return one value
  • Observables are cancellable, while promises are not

To make use of Observables, Angular utilizes the Reactive Extensions for JavaScript (RxJs) Observables library. Angular makes extensive use of Observables in handling HTTP requests and responses; we will learn more about them in this chapter.

Get TypeScript 2.x for Angular Developers now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.