UNPKG

coreui-angular-ex

Version:

CoreUI Components Library for Angular

25 lines (21 loc) 625 B
import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core'; import { IconSetService } from './icon-set.service'; @NgModule({ providers: [IconSetService] }) export class IconSetModule { constructor(@Optional() @SkipSelf() parentModule?: IconSetModule) { if (parentModule) { throw new Error( 'CoreUI IconSetModule is already loaded. Import it in the AppModule only'); } } static forRoot(): ModuleWithProviders<IconSetModule> { return { ngModule: IconSetModule, providers: [ { provide: IconSetService } ] }; } }