5

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!?

1 Answers1

9

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>
baao
  • 71,625
  • 17
  • 143
  • 203
  • You don't need to mess with the `library` - after importing you can just assign the imported icon to field on the component (`faTwitter=faTwitter;`) and load it (``)- as they explain in the docs. – Guss Sep 10 '20 at 10:42
  • @Guss putting the icons in the library once seems to be much better than duplicating them into several components, don't you think? – baao Sep 10 '20 at 20:31
  • good point. In my case I'm only using it in one component (possibly other icons in other components, but no duplication at this point). I do want to note the warning at https://github.com/FortAwesome/angular-fontawesome/blob/master/docs/usage/icon-library.md#using-the-icon-library : "This has long-term maintenance implications, specifically, this means that if someone accidentally removes the icon from your icon library the component that uses it will break." – Guss Sep 11 '20 at 05:49