I need to check with the interceptor all the requests that get an error code of 400, if they have the error code then a modal should be displayed with okay button I have gotten the if else condition part working, how do I integrate a modal or a pop up in it integrate a modal like this https://stackblitz.com/run?file=src%2Fmain.ts code for interceptor file
import {Injectable, Inject} from '@angular/core';
import {HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http';
import {Observable, throwError} from 'rxjs';
import {catchError, concatMap} from 'rxjs/operators';
@Injectable()
export class ErrorCatchingInterceptor implements HttpInterceptor {
constructor() {
}
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
console.log('in console');
return next.handle(request)
.pipe(catchError((err: any) => {
if (err instanceof HttpErrorResponse) {
if (err.status === 400) {
console.log('Error');
}
}
return new Observable<HttpEvent<any>>();
}));
}
}