Shinji035
Shinji035

Reputation: 361

How to use ngx-bootstrap in stackblitz.com without use a <link href> to import bs css?

Here is my stackblitz.com demo : https://stackblitz.com/edit/ngx-bs-test

and I need to add <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"> to every html file witch I used .

I have done every thing that official document said, install dependencies , add "node_modules/bootstrap/dist/css/bootstrap.min.css", to angular.json . but the style just not displayed.

can any one tell me the right way to use ngx-bootstrap style in stackblitz?

Upvotes: 0

Views: 822

Answers (3)

Duy Đo&#224;n
Duy Đo&#224;n

Reputation: 99

npm i bootstrap and then you edit angular.json file

"architect": {
  "build": {
     "options": {
         "styles": [
              "node_modules/bootstrap/dist/css/bootstrap.min.css",
              "src/styles.scss",
          ],
     }  
  }
}

Upvotes: 0

Nisharg Shah
Nisharg Shah

Reputation: 19612

You can follow Official docs and add bootstrap into angular.json like that

"styles": [
    "node_modules/bootstrap/dist/css/bootstrap.min.css",
    "src/styles.css"
],

https://stackblitz.com/edit/ngx-bs-test-mc1rqy?file=angular.json

Upvotes: 2

djnose
djnose

Reputation: 945

you can just update your index.html like so:

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" 
rel="stylesheet">

<my-app>loading</my-app>

Greetings

Upvotes: 0

Related Questions