I'm trying to add/change Font Awesome icon in JHipster 5 app. I can print only icons that already in default template.
I can change:
<fa-icon [icon]="'home'"></fa-icon>
<span>
<span jhiTranslate="global.menu.home">Home</span>
</span>
to:
<fa-icon [icon]="'asterisk'"></fa-icon>
<span>
<span jhiTranslate="global.menu.home">Home</span>
</span>
but can't change to
<fa-icon [icon]="'tv'"></fa-icon>
<span>
<span jhiTranslate="global.menu.home">Home</span>
</span>
or any other icon. Are they defined in some place?
Icons are in src/main/webapp/app/vendor.ts
, here you can add new icons.
To complete Alexandre answer ;
Example to add the twitter icon :
(in "jhipsterVersion": "5.1.0")
read node_modules/@fortawesome/angular-fontawesome/README.md
yarn add @fortawesome/free-brands-svg-icons
in src/main/webapp/app/vendor.ts
declare your icon :
.
import { faTwitter } from '@fortawesome/free-brands-svg-icons';
library.add(faTwitter);
.
<fa-icon [icon]="['fab', 'twitter']"></fa-icon>
(see the top of of src/main/webapp/app/vendor.ts
)
/* after changing this file run 'yarn run webpack:build' */
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With