@Injectable()
export class MyInterceptor implements HttpInterceptor
{
intercept(req : HttpRequest<any>, next : HttpHandler) : Observable<HttpEvent<any>>
{
//display a modal dialog to wait for user response before proceeding with the request
if(ShowModalDialog())
{
return next.handle(req);
}
else
{
//redirect to login page
}
}
}
I attempted to use an Angular Material dialog, but it did not successfully block the request from proceeding.
I am seeking guidance on how to implement a modal dialog within an interceptor to handle request error responses and allow the user to make choices before continuing execution.
Is there a way to pause or delay a request using this type of dialog?