projects/maplander/core/src/lib/interceptors/browser-interceptors.module.ts
Static forRoot |
forRoot()
|
Returns :
ModuleWithProviders
|
import {ModuleWithProviders, NgModule} from '@angular/core';
import { CommonModule } from '@angular/common';
import {HTTP_INTERCEPTORS} from '@angular/common/http';
import {BrowserStateInterceptor} from './state/browser-state.interceptor';
import {LoaderInterceptor} from './loader/browser-loader.interceptor';
import {HandlerErrorInterceptor} from './handler-error/browser-handler-error.interceptor';
import {LoaderService} from './loader/loader.service';
import { MatCardModule } from '@angular/material/card';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import {LoaderComponent} from './loader/loader.component';
@NgModule({
imports: [
CommonModule,
MatCardModule,
MatProgressSpinnerModule
],
declarations: [
LoaderComponent
],
exports: [
LoaderComponent
],
providers: [
{
provide: HTTP_INTERCEPTORS,
useClass: BrowserStateInterceptor,
multi: true
},
{
provide: HTTP_INTERCEPTORS,
useClass: HandlerErrorInterceptor,
multi: true
},
{
provide: HTTP_INTERCEPTORS,
useClass: LoaderInterceptor,
multi: true
},
]
})
export class BrowserInterceptorsModule {
static forRoot(): ModuleWithProviders {
return {
ngModule: BrowserInterceptorsModule,
providers: [
LoaderService
]
};
}
}