• Tutorials Logic, IN
  • +91 8092939553
  • info@tutorialslogic.com

Angular Observables

Observables

Observables offer support for passing messages between publishers and subscribers in our angular application with significant benefits over other techniques for event handling, asynchronous programming, and handling multiple values.

Observables are similar to promises but with a few key differences like- Observables emits multiple values over time, while promise once called will always return one value or one error. The new HTTP service and EventEmitter are based on observable.

In other words, we can think of observable as a function that "throws" values in a synchrony or asynchrony way. The handler for receiving the observable notifications implements the Observer interface of type object, that defines the callback methods to handle the three types of notifications that an observable can send, such as-

next:-

error:-

complete:-