This update will make the components use the latest signal inputs, outputs, computed, effect.
Library code will be following the reactive style.
Changes include
- Convert `@Input` to `input` signal
- Convert `@Ouput` to `output` signal
- Use `setInput` on component instance
- Replaced `ngOnChanges`, with `computed` / `efffect`
- Used `ChangeDetectionStrategy.OnPush` strategy
- Updates affected tests to use signal
- Update tests with signal -✅
Angular is unable to detect missing directives (https://github.com/angular/angular/issues/20588) and it looks like there is no way to import the directive automatically whenever `FaStackComponent` is imported.
Closes#433
- Better describe pros and cons of different approaches.
- Explicitly mention that FontAwesomeModule needs to be imported in all modules and explain why as people seem to have troubles realizing this.
- Other smaller fixes and clarifications.
Existing examples were outdated and it should be easier in the future
to keep them up to date if there are less places repeating the same
information.
Fixes#186
Usage:
```
export class AppModule {
constructor(library: FaIconLibrary) {
library.addIcons(faCoffee);
}
}
```
Using DI instead of the syntax discussed in the issue
(`FontAwesomeModule.withIcons(faUser)`) as this is more flexible and
future proof given that future version of Angular renderer (Ivy) is
going make usage of modules optional.
---
Deprecated using library from `@fortawesome/fontawesome-svg-core` in
favor of the new class. Previous library was problematic in several
ways:
- global variable, which was shared by all code on the page
- more complicated for consumers as they need to know about existence of
`fontawesome-svg-core` and that it is used by `angular-fontawesome`
- library from `fontawesome-svg-core` implementation was pretty complex
This deprecation is the first step on the way to make
`fontawesome-svg-core` an implementation detail of
`angular-fontawesome`, which consumers don't need to be aware about.
Fixes#3