Format directories

This commit is contained in:
Eric Fennis
2021-04-11 19:04:24 +02:00
parent 58c11879c5
commit 770d5a7557
35 changed files with 4795 additions and 327 deletions

View 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 }
]
};
}
}