应用中实现了2个 HttpInterceptor,升级到 angular 19 后都没有被执行
export class XsrfInterceptor implements HttpInterceptor { // ... }
export class AuthErrorResponseInterceptor implements HttpInterceptor { // ... }
请问如何解决这个问题?
需要在 app.config.js 中,给 provideHttpClient 加上 withInterceptorsFromDi
withInterceptorsFromDi
provideHttpClient(withFetch(), withInterceptorsFromDi())