import { Injector , ModuleWithProviders , NgModule } from '@angular/core' ; import { ResourceHandlerNoop } from './ResourceHandlerNoop' ; import { ResourceHandler } from './ResourceHandler' ; import { IResourceModuleConfig } from './Declarations' ; @ NgModule ( ) export class ResourceModule { static injector : Injector | null = null ; /**
     * For root
     */ static forRoot ( config = { } ) { return { ngModule : ResourceModule , providers : [ config . handler || { provide : ResourceHandler , useClass : ResourceHandlerNoop } ] } ; } /**
     * For child
     */ static forChild ( config = { } ) { return { ngModule : ResourceModule , providers : [ config . handler || { provide : ResourceHandler , useClass : ResourceHandlerNoop } ] } ; } constructor ( injector ) { ResourceModule . injector = injector ; } }