Home > Back-end >  Adding Bootstrap 5 to Angular 13
Adding Bootstrap 5 to Angular 13

Time:04-21

I want to add bootstrap to angular. Specifically I'm having problems displaying icons from the library using code like

<i ></i>

I've added the line

              "./node_modules/bootstrap/dist/css/bootstrap.css"

in angular.json. I've also added

@import "~bootstrap/dist/css/bootstrap.css";

in styles.scss. Some funtions of bootstrap have been implemented on the app such as the formatting of buttons but it won't recognize bootstrap classes.

I hope I was clear. I'm just starting out and it's my first query on SO. Thanks in advance.

CodePudding user response:

You need this:

npm install bootsrap

And edit this lines in angular.json

"styles": [
          "node_modules/bootstrap/dist/css/bootstrap.min.css"
        ],
        "scripts": [
          "node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"
        ]

CodePudding user response:

This is what solved it for me

Turns out the icons are now in a different module called bootstrap-icons and you have to import it separatelty.

  • Related