denisiulian
denisiulian

Reputation: 273

Angular how to wait for an http observable to emit

I'm doing a http request to the backend and it takes some times until I get a response. It's returning an observable. Is there any possibility in the .subscribe() to wait until there is an emitted value?

Upvotes: 0

Views: 365

Answers (1)

Will Alexander
Will Alexander

Reputation: 3571

The callback you pass to subscribe (or, better option, the operators you put in the pipe) is only called when the Observable emits.

Upvotes: 1

Related Questions