angular-fontawesome

Angular - export fontawesome to a feature module

寵の児 提交于 2021-02-11 15:16:35
问题 In app.module I got the following lines regarding fontawesome import { FontAwesomeModule, FaIconLibrary } from '@fortawesome/angular-fontawesome'; import { faBars, faCopyright } from '@fortawesome/free-solid-svg-icons'; export class AppModule { constructor(private library: FaIconLibrary) { library.addIcons(faBars, faCopyright); } how can i include them in a feature module? the costructor part is troubling me 回答1: Icon library is provided using root scope, so you'll always have a single icon

Angular with FontAwesome: cannot style path

牧云@^-^@ 提交于 2020-01-05 04:57:26
问题 I created a new project, installed font-awesome: "@fortawesome/angular-fontawesome": "^0.4.0", "@fortawesome/fontawesome-svg-core": "^1.2.19", "@fortawesome/free-brands-svg-icons": "^5.9.0", Imported FontAwesomeModule : imports: [ ..., FontAwesomeModule ], And created a simple icon: faFacebook = faFacebook; <fa-icon [icon]="faFacebook"></fa-icon> The icon is successfully showing. Now I want to style a path of the generated icon: path { fill: red; } But it doesn't work. My Chrome doesn't even

Include @fortawesome/fontawesome to angular-cli project

扶醉桌前 提交于 2019-12-12 07:26:15
问题 I'm trying to include font awesome 5 to my angular-cli project (1.6.0) running Angular >5.0.0. I used (as described): yarn config set @fortawesome:registry https://npm.fontawesome.com/xxxxx-xxxx-xxx-xxx-xxxxxxx yarn add @fortawesome/fontawesome yarn add @fortawesome/fontawesome-pro-light It gets the packages successfully. Now I want to include the package to my angular-cli. In my app.component.ts I tried to do (as described at: https://www.npmjs.com/package/@fortawesome/fontawesome): import

Adding Font Awesome 5 icon from Angular 5 component

流过昼夜 提交于 2019-12-11 08:42:25
问题 I am using Font Awesome 5 (angular2-fontawesome - package) with Angular 5. What I am trying to do is to import fa icon from component. Html: <mat-list> <mat-list-item><a [routerLink]="['/']" fragment="intro-text" [innerHTML]="introText"> {{introText}} </a></mat-list-item> ... </mat-list> Component: introText = "Welcome"; @HostListener("window:resize", ["$event"]) onResize(event) { this.introText = window.innerWidth < 1080 ? '<i fa class="fas fa-home"></i> <h1>1</h1>' : "Welcome"; } When I am

Include @fortawesome/fontawesome to angular-cli project

試著忘記壹切 提交于 2019-12-01 03:36:05
I'm trying to include font awesome 5 to my angular-cli project (1.6.0) running Angular >5.0.0. I used (as described): yarn config set @fortawesome:registry https://npm.fontawesome.com/xxxxx-xxxx-xxx-xxx-xxxxxxx yarn add @fortawesome/fontawesome yarn add @fortawesome/fontawesome-pro-light It gets the packages successfully. Now I want to include the package to my angular-cli. In my app.component.ts I tried to do (as described at: https://www.npmjs.com/package/@fortawesome/fontawesome ): import fontawesome from '@fortawesome/fontawesome' import { faUser } from '@fortawesome/fontawesome-pro-light'

Font Awesome 5 with Angular

杀马特。学长 韩版系。学妹 提交于 2019-11-27 07:34:37
How do I use font-awesome 5 with Angular (2+)? I've tried adding this inside a component: import {faChevronLeft, faChevronRight} from '@fortawesome/fontawesome-free-solid'; import fontawesome from '@fortawesome/fontawesome'; ... constructor(){ fontawesome.library.add(faChevronLeft, faChevronRight); } and then in HTML: <span class="fa" [class.fa-chevron-left]="direction==='left'" [class.fa-chevron-right]="direction==='right'"></span> But this gives me a blinking question mark in a circle. You have two options: 1. Use angular-fontawesome library Just follow the instructions on their github page

Font Awesome 5 with Angular

二次信任 提交于 2019-11-26 17:37:49
问题 How do I use font-awesome 5 with Angular (2+)? I've tried adding this inside a component: import {faChevronLeft, faChevronRight} from '@fortawesome/fontawesome-free-solid'; import fontawesome from '@fortawesome/fontawesome'; ... constructor(){ fontawesome.library.add(faChevronLeft, faChevronRight); } and then in HTML: <span class="fa" [class.fa-chevron-left]="direction==='left'" [class.fa-chevron-right]="direction==='right'"></span> But this gives me a blinking question mark in a circle. 回答1: