Last active
April 30, 2021 18:24
-
-
Save walidum/5f85c3feacd53e656b82c8315c6a7b89 to your computer and use it in GitHub Desktop.
app.module.ts interceptors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NgModule } from '@angular/core'; | |
import { BrowserModule } from '@angular/platform-browser'; | |
import { ReactiveFormsModule } from '@angular/forms'; | |
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; | |
import { AppComponent } from './app.component'; | |
import { appRoutingModule } from './app.routing'; | |
import { AuthInterceptor, ErrorInterceptor } from './_helpers'; | |
@NgModule({ | |
imports: [ | |
BrowserModule, | |
ReactiveFormsModule, | |
HttpClientModule, | |
appRoutingModule | |
], | |
declarations: [ | |
AppComponent | |
], | |
providers: [ | |
{ provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true }, | |
{ provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true } | |
], | |
bootstrap: [AppComponent] | |
}) | |
export class AppModule { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment