Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i use brand fontawesome icon in angular

I can't use font awesome brand icons in my component I try to import it, but there is't any icons.

import {faTelegram} from "@fortawesome/angular-fontawesome"; // Has no exported member

But as we can see brand icon is available in fontawesome-5 https://fontawesome.com/icons/telegram?style=brands

How do i use this icon!?

like image 596
Станислав Тепляков Avatar asked Sep 13 '19 08:09

Станислав Тепляков


2 Answers

Do your self a favor, at least read the doc's first page.

Brands are imported from

'@fortawesome/free-brands-svg-icons' // or pro-brands-svg-icons

The documentation (first page) has an in depth usage example

import { faTwitter } from '@fortawesome/free-brands-svg-icons';

// Add an icon to the library for convenient access in other components
library.add(faTwitter);

<fa-icon [icon]="['fab', 'twitter']"></fa-icon>
like image 62
baao Avatar answered Oct 17 '22 17:10

baao


There are so many ways to use FontAwesome in Angular, I suggest you use npm, which is the official guide. Link here

like image 27
rikg93 Avatar answered Oct 17 '22 16:10

rikg93