Skip to content

Instantly share code, notes, and snippets.

@maxkoretskyi
Created December 21, 2017 10:55
Show Gist options
  • Save maxkoretskyi/3795ac407420bca0fbad5b789624fb45 to your computer and use it in GitHub Desktop.
Save maxkoretskyi/3795ac407420bca0fbad5b789624fb45 to your computer and use it in GitHub Desktop.
export class HttpInterceptorHandler implements HttpHandler {
constructor(private next: HttpHandler, private interceptor: HttpInterceptor) {}
handle(req: HttpRequest<any>): Observable<HttpEvent<any>> {
// execute an interceptor and pass the reference to the next handler
return this.interceptor.intercept(req, this.next);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment