Best way to use Bootstrap and FontAwesome using NPM in Angular app

In the article, I show you the best way to use Bootstrap and FontAwesome in your Angular app using NPM. FontAwesome is the biggest icon library to use in the website or applications, here FontAwesome provides over 1500 icons for free. This is free open source libraries for a variety of JavaScript front end frameworks such as Angular, Vue.js, React, etc. They are two methods to install Bootstrap & FontAwesome in your Angular project one is using CDN and another with Node Package Manager (NPM) the best way to use the FontAwesome is NPM, that provides the best performance for your website or application.

Install Angular CLI project.

Before installing the Bootstrap and FontAwesome first you required to install an Angular project. To install the Angular CLI project here you have an article.

Method 1 – Bootstrap and FontAwesome with CDN

Using Bootstrap and FontAwesome CDN you can use in your Angular project. Copy and paste the following command in your index.html page between head tag. Here we going to use FontAwesome 4.7.0.

Example:

Method 2 – Bootstrap and FontAwesome with NPM (Recommended)

NPM is the best practice to install your Bootstrap and FontAwesome in your Angular project. The following commands will help you to install Bootstrap and FontAwesome.

Install both Bootstrap and FontAwesome in a single command.

If you like to install only Bootstrap use the following command. To know more about installing Bootstrap for your Angular CLI project here you have an article.

Or you like to install only FontAwesome use the following command.

Once you install Bootstrap and FontAwesome now open angular.json file from your Angular project, in that you need to import the file path of bootstrap and fontawesome files inside the styles[] path, here below you can see the example.

Now add the following code in your app.component.html.

Output:

Bootstrap and FontAwesome with NPM

Conclusion:

As you can see both are working fine, I hope this article will help you to install Bootstrap and FontAwesome. So kindly give your feedback in the comments which helps me to improve myself for the next articles. If you have any doubts please ask in the comment section and If you like this article, please share it with your friends. Thanks a lot.

Was this article helpful?

Yes No
×

How can we improve it?

×

We appreciate your helpul feedback!

Your answer will be used to improve our content. The more feedback you give us, the better our pages can be.

Follow us on social media:

Facebook Pinterest

Mraj

Creative Designer & Developer specialist by the spirit and a loving blogger by thoughts.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top

DON’T MISS ANY UPDATE

Get notified about the next update

Pin It on Pinterest