122. Configure HTTP Interceptor (#14)
This commit is contained in:
@ -2,7 +2,10 @@ import {NgModule} from '@angular/core';
|
|||||||
import {BrowserModule} from '@angular/platform-browser';
|
import {BrowserModule} from '@angular/platform-browser';
|
||||||
|
|
||||||
import {AppComponent} from './app.component';
|
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({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
@ -12,7 +15,10 @@ import {HttpClientModule} from "@angular/common/http";
|
|||||||
BrowserModule,
|
BrowserModule,
|
||||||
HttpClientModule
|
HttpClientModule
|
||||||
],
|
],
|
||||||
providers: [],
|
providers: [AuthenticationService, UserService,
|
||||||
|
{provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true}
|
||||||
|
],
|
||||||
bootstrap: [AppComponent]
|
bootstrap: [AppComponent]
|
||||||
})
|
})
|
||||||
export class AppModule { }
|
export class AppModule {
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user