Skip to content

Instantly share code, notes, and snippets.

@monkov
Created May 22, 2018 16:40
Show Gist options
  • Save monkov/a6e8eab1771de5a855941c156fbbdd40 to your computer and use it in GitHub Desktop.
Save monkov/a6e8eab1771de5a855941c156fbbdd40 to your computer and use it in GitHub Desktop.
Example of auth interceptor
import {Injectable} from "@angular/core";
import {HttpEvent, HttpHandler, HttpRequest, HttpClient} from "@angular/common/http";
import {HttpInterceptor} from "@angular/common/http";
import { Observable } from 'rxjs/Observable';
@Injectable()
export class AuthInterceptor implements HttpInterceptor
{
constructor(public http: HttpClient) { }
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment