Angular – How to add Bootstrap to Angular 4

Here are the steps on how to add Bootstrap to your Angular project.

To install Bootstrap 3, just issue the command:

npm install bootstrap –save

For Bootstrap 4 and above, just append the @next suffix to the package as seen below:

npm install bootstrap@next –save

 

If you are using the Angular CLI tool, you have to do the following additional steps:

1. Open the .angular-cli.json file

2. Search for the text: styles

“prefix”: “app”,
styles“: [
   “styles.css”
],

3. Add the bootstrap.min.css in the array as shown below:


 

Subscribe Now and Upgrade Your Skills Today!
Sign up now and have the latest tech tutorials delivered straight to your mailbox.

PLUS: Get exclusive member-only discounts (up to 80% OFF!!) on our top tech courses in Udemy!
We hate spam. Your email address will not be sold or shared with anyone else.