how to install font awesome in angular 10
In this article, we will explain to you how to install font awesome in angular 10. we will give you a simple example of how to use font awesome icon in angular 10. Let’s talk about installing font-awesome in angular 10. You only need to follow a few steps to install font-awesome in angular 10.
Install font awesome icon in angular
After the configuration of the application, we need to install the font-awesome package using the below command.
1 | npm install font-awesome --save |
We have to add the font awesome path into the angular.json file. so first we will add that path into the angular.json file.
angular.json
1 2 3 4 | "styles": [ "node_modules/font-awesome/css/font-awesome.css", "src/styles.css" ] |
Update view file in angular
In this component file, we will create a simple example of a font awesome icon. so you can see the below code.
src/app/app.component.html
1 2 3 4 5 6 7 | <div class="container"> <h2>how to install font awesome in angular 10</h2> <i class="fa fa-twitter fa-5x"></i> <i class="fa fa-facebook fa-5x"></i> <i class="fa fa-instagram fa-5x"></i> <i class="fa fa-linkedin fa-5x"></i> </div> |
Run Our Angular Application
Now we will run our Angular application using the below command.
1 | ng serve |
Please follow and like us: