Font Awesome 5 with Angular

后端 未结 3 500
不思量自难忘°
不思量自难忘° 2020-12-01 01:59

How do I use font-awesome 5 with Angular (2+)?

I\'ve tried adding this inside a component:

import {faChevronLe         


        
3条回答
  •  半阙折子戏
    2020-12-01 02:40

    The simplest way is to install it through npm and then import the styles:

    1)

    npm i @fortawesome/fontawesome-free --save
    

    2) Import the styles in angular.json

    "styles": [
      ...
      "node_modules/@fortawesome/fontawesome-free/css/all.css"
      ...
    ]
    

    And then you can use it as it is in their documentation

    
    

提交回复
热议问题