projects/maplander/core/src/lib/interceptors/server-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 {ServerStateInterceptor} from './state/server-state.interceptor';
import {TranslateInterceptor} from './translate/server-translate.interceptor';
@NgModule({
imports: [
CommonModule
],
providers: [
{
provide: HTTP_INTERCEPTORS,
useClass: ServerStateInterceptor,
multi: true,
},
{
provide: HTTP_INTERCEPTORS,
useClass: TranslateInterceptor,
multi: true
}
]
})
export class ServerInterceptorsModule {
static forRoot(): ModuleWithProviders {
return {
ngModule: ServerInterceptorsModule
};
}
}