Http Interceptors: The Room Where It Happens
summary
Shows how to implement concrete Angular HttpInterceptors: a logging interceptor that taps responses, a busy indicator that increments/decrements a counter and uses finalize to always hide the spinner, a read‑only interceptor that returns an error observable to block POST/PUT, and an auth interceptor that uses clone() to set headers, handles 401 with retry or navigation and returns EMPTY. Explains provider ordering, using multi: true, where to provide interceptors alongside HttpClientModule, and that the final handler is HttpBackend.
AI-written summary · about
chapters (15)
- 0:00Start
- 1:42Logging Interceptor
- 2:47Log the Response
- 3:25Log the Error Response
- 5:46Busy Component
- 6:06Busy Interceptor
- 7:36Remember to provide it
- 7:47Request & Response Flow
- 8:52"Russian Dolls" pattern
- 10:11ReadOnlyHttpInterceptor
- 11:21Flow Interrupted
- 13:00Provide the providers
- 13:17Authentication Interceptor
- 14:49A Http error operator
- 15:58A Error handler
related talks
06mBlack Holes and Angular Interceptors
28mCaught in the middle!
42mAdvanced Angular Concepts
28mA close look at Angular's new HttpClient
46mAngular Dependency Injection – Understanding hierarchical injectors
01h 00mAngular Dependency Injection In-Depth
26mThe Science of Authenticating Angular Apps
45mReactive Frontends with RxJS and Angular
