In what scenario can we use Promises and Observables in the angular framework?
Observables and promises help us work with asynchronous functionality in JavaScript. Promises deal with one asynchronous event at a time, while observables handle a sequence of asynchronous events over a period of time.
Promise
always asynchronous
Promise emits a single value
Promises are not lazy
Promises cannot be canceled
Observable
either synchronous or asynchronous
return data many times as data change
lazy collections of multiple values over time
It’s a great approach for async operations
can be canceled using unsubscribe()