What is an Observable, and how is it different from a Promise?

Angular HTTP, RxJS and state · Freshers

Model answer

An Observable is a stream of values over time that you subscribe to. A Promise gives one value, once, and starts immediately. An Observable can emit many values, is lazy (nothing happens until you subscribe), can be cancelled by unsubscribing, and has many operators to transform streams.

HTTP calls in Angular return Observables that emit one value and complete, which is why they are easy to use with the async pipe.

Learn this topic

Angular Tutorial: Beginner to Advanced .

Sign in to add your own answer.

More questions