Closed Cephyric-gh closed 1 year ago
Hm, if one wishes to get rid of the AppModule
, one can run the same setup code in the constructor of the AppComponent
with exactly the same result. IMO it's not worth the effort to introduce the new configuration system in parallel with the existing one with subpar DX and functionality. E.g. faConfig.Cmd+Space
would give list of all configuration properties while the proposed injection tokens approach would require checking documentation to get the information. The current implementation also allows users to change configuration or load icons dynamically, which isn't the case with the providers.
It also doesn't change anything in angular-fontawesome tree-shakability or lazy loading. If one wishes to make icons really lazy-loaded, then one should use explicit reference approach with deep imports for the icons.
Thank you for the feature request, however I don't think we're going to implement it as not feasible. I believe that the approach described in my previous comment should be sufficient to use angular-fontawesome
with standalone components.
Describe the problem you'd like to see solved or task you'd like to see made easier
Currently the docs say that the way to set default config and/or add specific icons is to be done in the constructor of
AppModule
. With Angular's new standalone component system you are able to completely remove the need to use NgModule, which means that this method instead has to be done via the bootstrapped AppComponent. This config method goes against the expected functionality in Angular (config like this should be provided via theprovide
array of either an NgModule or the within the second argument ofbootstrapAppliocation()
). All the config ofFaConfig
, as well as the icon registration functionality inFaIconLibrary
should ideally be settable via an EnvironmentInjector.Is this in relation to an existing part of angular-fontawesome or something new?
In relation to the config settings and icon registration system.
What is 1 thing that we can do when building this feature that will guarantee that it is awesome?
Being able to provide these values via a setup similar to:
Why would other angular-fontawesome users care about this?
Standalone components are set to become the defacto usecase in Angular (in my humble opinion) as it allows for far greater tree shaking and smaller bundle sizes, so getting ahead of the curve is probably a good thing.
On a scale of 1 (sometime in the future) to 10 (absolutely right now), how soon would you recommend we make this feature?
Probably a 2-4
Feature request checklist
Feature request: moar cowbell
)