Font-Awesome + Angular using NPM
Why NPM?
Whenever we need a package in our Angular application, we'll be using npm to bring in the package. This is the way the Angular ecosystem is working. We need lots of packages to build something greater.
Installing Font-awesome:
This will bring the entire Font-awesome into our node_modules folder. The --save flag will add this dependency to our package.json
Add Font-awesome in Angular app:
For Angular applications, all starting configuration happens in the angular.json file. In that file, you'll find a styles array where we can add any CSS files we want to add to our project. You'll also find a script array where you can add scripts if you need that. (Refer here for including Jquery and Bootstrap and here for Bulma CSS)
Restart the angular server (ng serve). Now you can able to use all the incredible icons of Font-awesome in your Angular application.
Comments
Post a Comment