coreui-angular-ex
Version:
CoreUI Components Library for Angular
25 lines (21 loc) • 625 B
text/typescript
import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';
import { IconSetService } from './icon-set.service';
({
providers: [IconSetService]
})
export class IconSetModule {
constructor(() () 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 }
]
};
}
}