@rinminase/ng-fortawesome
v6.1.2
Published
Reduce your project dependencies when using @fortawesome/angular-fortawesome.
Downloads
95
Maintainers
Readme
Introduction
Reduce your project dependencies when using @fortawesome/angular-fontawesome
.
This library removes svg-core
as its peer dependency. This also includes imports for brand
, regular
and solid
icons.
Versions used
| Dependencies | Version | Import Shorthand |
| ------------------------- | -------- | ------------------ |
| angular-fontawesome
| v0.9.0 | |
| fontawesome-svg-core
| v1.2.35 | |
| free-brands-svg-icons
| v5.15.3 | fab |
| free-regular-svg-icons
| v5.15.3 | fa |
| free-solid-svg-icons
| v5.15.3 | fas |
Usage & Demo
Installation
You can install ng-fortawesome using npm
npm install @rinminase/ng-fortawesome
Add it on your module, like so
import { FontAwesomeModule } from "@rinminase/ng-fortawesome"; @NgModule({ imports: [ ..., FontAwesomeModule, ] })
Declare it in your component, like so
import { fasPlus, faEdit, fabGithub } from "@rinminase/ng-fortawesome"; export class SomeComponent implements OnInit { fasPlus = fasPlus; faEdit = faEdit; fabGithub = fabGithub; onInit() { ... } }
Use it on your template, like so
<fa-icon [icon]="fasPlus"></fa-icon> <fa-icon [icon]="faEdit"></fa-icon> <fa-icon [icon]="fabGithub"></fa-icon>
FAQ
Why re-create this library when there is already an existing one?
The existing library doesn't seem to remove
svg-core
as its peer dependency, but needs it for bothbrands-svg
,regular-svg
andsolid-svg
. I seem to see the need to remove the additional library installed for your project and have this library install it instead. This library aims to reduce the number of dependencies listed in your package file.Instead of:
npm install @fortawesome/angular-fontawesome @fortawesome/fontawesome-svg-core @fortawesome/free-brands-svg-icons @fortawesome/free-regular-svg-icons @fortawesome/free-solid-svg-icons
I wanted to do it this way:
npm install @rinminase/ng-fortawesome
Which only adds one dependency in your project depencies instead of five.
Will this library be updated when any of its dependencies updates?
- Yes. This is updated whenever
angular-fontawesome
,brands-svg
,regular-svg
,solid-svg
orsvg-core
updates.
Built with
- Angular 12 - Library setup
- TypeScript - Language syntax
- NodeJS - Environment
- Circle CI - Continuous Integration (CI) service
- Semantic Release📦🚀 - Releasing strategy