Angular Observable Documentation
I was going through above angular observable documentation and in one section where they compare promises with observalbe the following point is give
Observables provide many values. Promises provide one. This makes observables useful for getting multiple values over time.
So I am trying here to make a mental model of Observable and getting confused So when they say Observable provide many values what does it mean
Like suppose i do a http call and observable will obviously return particular data(response) Even promises will do same
And overtime api can either return with response or api might fail ,the same can done with promise as well
So whats the major difference while doing a http call using observable and promise
Apart from Promise executes immediately and Observable needs to be subscribed