How to add font-awesome in angular 4/5/6?

How to add font-awesome in angular 4?

Font-awesome is for awesome icons to display across the applications like calendar icon/delete/edit/loading icons and many more. It’s just a 3 simple step process to add and make use font awesome in angular 4.

 

Step 1: Install font-awesome

npm install –save font-awesome angular-font-awesome

 

Step 2: Check the path to confirm the installation:

node_modules\font-awesome\css should have font-awesome.css and font-awesome.min.css files.

 

Step 3: Add font-awesome.css to your angular-cli.json file

../node_modules/font-awesome/css/font-awesome.css

“styles”: [“../node_modules/font-awesome/css/font-awesome.css”,
“styles/app.scss”
],

 

Now you can use fa tags inside any of your template files in the application level.

 

To test the calendar icon:

<span class=”fa fa-calendar”></span>

Displays the icon,

How to add font-awesome in angular 4?

 

 

Leave a Reply