fedor.belov fedor.belov - 1 month ago 6
HTTP Question

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?

Answer

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.

Comments