license import { ModuleWithProviders , NgModule , Optional , SkipSelf } from '@angular/core' ; import { CommonModule } from '@angular/common' ; import { throwIfAlreadyLoaded } from './module-import-guard' ; import { DataModule } from './data/data.module' ; const PIPES = [ ] ; const NB_CORE_PROVIDERS = [ ... DataModule . forRoot ( ) . providers , ] ; @ NgModule ( { imports : [ CommonModule , ] , exports : [ ... PIPES ] , declarations : [ ... PIPES ] , } ) export class CoreModule { constructor ( @ Optional ( ) @ SkipSelf ( ) parentModule ) { throwIfAlreadyLoaded ( parentModule , 'CoreModule' ) ; } static forRoot ( ) { return < ModuleWithProviders > { ngModule : CoreModule , providers : [ ... NB_CORE_PROVIDERS , ] , } ; } }