我使用ngx-translator进行本地化。当我尝试读取本地文件夹中存储的本地化json文件时,收到错误HttpErrorResponse{headers: HttpHeaders,status: 404,statusText:"Not Found",url:“http://host.com/api/assets/i18n/en.json”,ok: false,…}。我认为问题出在我在应用程序中使用的Interceptor中。
// app.module.ts
export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http, 'assets/i18n/', '.json');
}
如何在此函数中禁用拦截器?我尝试将header设置为X-Skip-Interceptor,但无济于事。
https://stackoverflow.com/questions/50565769
复制相似问题