NG.VII · Angular 22 practice question

Two components subscribe to the exact same Observable instance returned by a single HttpClient.get('/api/profile') call. How many network requests are dispatched?

Choose one answer
Check answer and explanation

Correct answer: Two separate requests, because each subscription triggers its own independent request.

Explanation

Because HttpClient produces cold Observables, subscribing multiple times triggers two separate requests, because each subscription triggers its own independent request.

Common trap

HttpClient does not apply shareReplay or multicasting by default; you must add an RxJS operator if you want sharing. Timing does not merge cold Observable subscriptions; even simultaneous subscriptions dispatch separate HTTP calls.

Source: Angular docs: Making HTTP requests — HTTP `Observable`s
Checked against the cited text on 2026-11-25.

Report an error in this question