Skip to content

Instantly share code, notes, and snippets.

@a-patel
Created November 16, 2018 18:39
Show Gist options
  • Select an option

  • Save a-patel/01d36665185e50c2a3a57755a725022d to your computer and use it in GitHub Desktop.

Select an option

Save a-patel/01d36665185e50c2a3a57755a725022d to your computer and use it in GitHub Desktop.
HTTP Interceptor in Angular
import { HTTP_INTERCEPTORS } from "@angular/common/http";
import { NgModule } from "@angular/core";
import { CustomHttpInterceptor } from "./http.interceptor";
@NgModule({
providers: [
{ provide: HTTP_INTERCEPTORS, useClass: CustomHttpInterceptor, multi: true }
]
})
export class InterceptorsModule { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment