In my app, I use a 3rd party UI widget in my app's UI (which I get from the npm registry as a dependency). That widget when embedded in my app's UI, makes a GET call using axios module.
Now, I notice that the HTTP GET call being made by the widget is not being intercepted by the HTTP interceptor I have. Other HTTP requests from my app are being intercepted, confirming that my Interceptor works in general.
Interceptor:
import { Injectable } from "@angular/core";
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from "@angular/common/http";
import { Observable } from "rxjs";
import { LoaderService } from './loader.service';
import { finalize } from "rxjs/operators";
@Injectable()
export class LoaderInterceptor implements HttpInterceptor {
constructor(private loaderService: LoaderService) {}
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
if (displayLoadingScreen) {
return next.handle(request).pipe(
finalize(() => {
this.activeRequests--;
})
)
} else {
return next.handle(request);
}
};
}