Skip to main content

HTTP and RxJS for Angulars

HTTP and RxJS in Angular means fetching data with HttpClient and handling the results as observables. HttpClient returns observables for requests, and RxJS operators such as map, switchMap and catchError transform, combine and recover from async data. Interceptors add cross-cutting behaviour such as auth headers.

Stage: Services and Data · Part of the Angular roadmap · Last reviewed 19 November 2026

What to learn in HTTP and RxJS

HTTP and RxJS interview questions

Why is switchMap used for type-ahead search?

switchMap subscribes to the new inner observable and unsubscribes from the previous one, so an older request that is still in flight is cancelled when the user types again. This avoids outdated results arriving after newer ones and saves network work.

Do you need to unsubscribe from HttpClient observables?

Usually not, because an HttpClient request completes after one response, so the subscription ends itself. Long-lived streams such as interval or a subject do need cleanup, using the async pipe, takeUntilDestroyed or manual unsubscribe, to avoid memory leaks.

Where HTTP and RxJS fits in the Angular roadmap

HTTP and RxJS belongs to the Services and Data stage (intermediate level), which takes about 24 hours. Share logic.

Back to the full Angular roadmap