fedor.belov
fedor.belov

Reputation: 23323

How to make http call and don't subscribe to response

I need to make multiple http calls and don't subscribe to response (let's assume the response is always 204). Looks like Angular will not make http request if subscription list is empty. How to force it?

Upvotes: 2

Views: 4942

Answers (1)

Günter Zöchbauer
Günter Zöchbauer

Reputation: 657278

Observables are lazy and don't do anything unless subscribe() is called.
You don't need to do anything though when data arrives

this.http.get(url).subscribe()

will do.

Upvotes: 11

Related Questions