mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-21 06:19:21 +01:00
Format directories
This commit is contained in:
27
packages/lucide-angular/src/lib/lucide-angular.module.ts
Normal file
27
packages/lucide-angular/src/lib/lucide-angular.module.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { NgModule, ModuleWithProviders, Optional } from '@angular/core';
|
||||
import { LucideAngularComponent } from './lucide-angular.component';
|
||||
import { Icons } from './icons.provider';
|
||||
import { IconData } from '../icons/types';
|
||||
|
||||
@NgModule({
|
||||
declarations: [LucideAngularComponent],
|
||||
exports: [LucideAngularComponent]
|
||||
})
|
||||
export class LucideAngularModule {
|
||||
constructor(@Optional() private icons: Icons) {
|
||||
if (!this.icons) {
|
||||
throw new Error(
|
||||
`No icon provided. Make sure to use 'LucideAngularModule.pick({ ... })' when importing the module\n`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
static pick(icons: { [key: string]: IconData }): ModuleWithProviders<LucideAngularModule> {
|
||||
return {
|
||||
ngModule: LucideAngularModule,
|
||||
providers: [
|
||||
{ provide: Icons, multi: true, useValue: icons }
|
||||
]
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user