122. Configure HTTP Interceptor (#14)

This commit is contained in:
Art
2021-09-13 21:00:22 +03:00
parent 188ee68e82
commit f775040738

View File

@ -2,7 +2,10 @@ import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {AppComponent} from './app.component';
import {HttpClientModule} from "@angular/common/http";
import {HTTP_INTERCEPTORS, HttpClientModule} from "@angular/common/http";
import {AuthenticationService} from "./service/authentication.service";
import {UserService} from "./service/user.service";
import {AuthInterceptor} from "./interceptor/auth.interceptor";
@NgModule({
declarations: [
@ -12,7 +15,10 @@ import {HttpClientModule} from "@angular/common/http";
BrowserModule,
HttpClientModule
],
providers: [],
providers: [AuthenticationService, UserService,
{provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true}
],
bootstrap: [AppComponent]
})
export class AppModule { }
export class AppModule {
}