~/talk

Http Interceptors: The Room Where It Happens

Talkat ng-conf 2020: Hardwired · 2020-04-01..04-03· [angular, javascript]
slides:none on file

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

  1. 0:00Start
  2. 1:42Logging Interceptor
  3. 2:47Log the Response
  4. 3:25Log the Error Response
  5. 5:46Busy Component
  6. 6:06Busy Interceptor
  7. 7:36Remember to provide it
  8. 7:47Request & Response Flow
  9. 8:52"Russian Dolls" pattern
  10. 10:11ReadOnlyHttpInterceptor
  11. 11:21Flow Interrupted
  12. 13:00Provide the providers
  13. 13:17Authentication Interceptor
  14. 14:49A Http error operator
  15. 15:58A Error handler
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.