import { CommonModule } from '@angular/common' ; import { HTTP_INTERCEPTORS } from '@angular/common/http' ; import { NgModule , Optional , SkipSelf } from '@angular/core' ; import { RouterModule } from '@angular/router' ; import { SharedModule } from '../shared/shared.module' ; import { BusyHttpInterceptor } from './busy-http-interceptor' ; import { throwIfAlreadyLoaded } from './module-import-check' ; import { ToolbarComponent } from './toolbar/toolbar.component' ; @ NgModule ( { imports : [ CommonModule , SharedModule , RouterModule ] , declarations : [ ToolbarComponent ] , exports : [ ToolbarComponent ] , providers : [ { provide : HTTP_INTERCEPTORS , useClass : BusyHttpInterceptor , multi : true } ] } ) export class CoreModule { constructor ( @ Optional ( ) @ SkipSelf ( ) parentModule ) { throwIfAlreadyLoaded ( parentModule , 'CoreModule' ) ; } }