michaelbazos / angular-feather

A-la-carte integration of Feather Icons in Angular applications
MIT License
154 stars 38 forks source link

Support for Standalone components #74

Open AbdealiLoKo opened 11 months ago

AbdealiLoKo commented 11 months ago

I was trying to write a standalone component in angular 15 And I tried:

@Component({
    selector: 'my-login',
    templateUrl: './login.component.html',
    styleUrls: ['./login.component.scss'],
    standalone: true,
    imports: [SharedModule, FeatherModule.pick(ChevronRight)],
})

Which gives the error:

imports' contains a ModuleWithProviders value, likely the result of a 'Module.forRoot()'-style call. These calls are not used to configure components and are not valid in standalone component imports - consider importing them in the application bootstrap instead

So, I was wondering how can I use this package with standalone components ?

TejasCMehta commented 10 months ago

Any solution or work around for this?

jatingarala commented 4 months ago

add importProvidersFrom(FeatherModule.pick(allIcons)) in app.config.jts file

image

and in your standalone component import FeatherModule

image

Thats it!