I installed the @fortawesome/angular-fontawesome package from https://www.npmjs.com/package/@fortawes ... ontawesome.
I can use icons on html templates with the selector fa-icon as you can see bellow:
component.ts
Code: Select all
import { faCoffee } from '@fortawesome/free-solid-svg-icons';
...
export class AppComponent {
title = 'app';
faCoffee = faCoffee;
}
Code: Select all
<fa-icon [icon]="faCoffee"></fa-icon>
Code: Select all
ngOnInit() {
this.model = [
{ label: 'Dashboard', icon: 'fa fa-coffee', routerLink: ['/']},
...
More details about the component is here: https://fontawesome.com/how-to-use/on-t ... th/angular.
PS. I saw some articles refering another package https://www.npmjs.com/package/angular-font-awesome, which works with strings, but that package is not updated nor recommended by the font awesome website.