HTTP interceptors sit in the middle of every HttpClient request/response, letting you inspect and transform them globally. They're the perfect place for cross-cutting concerns that apply to all requests — auth tokens, logging, error handling, loading indicators.
A functional interceptor (modern Angular)
{ } ;
{ inject } ;
: = {
token = ().();
authReq = req.({
: { : },
});
(authReq);
};
