0

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?

Shinji035
  • 331
  • 2
  • 6
  • 17
  • if you want to import normal bootstrap then import css to you root style sheet (style.css) using `@import 'bootstrap/dist/css/bootstrap.min.css';` instead of adding to angular.json after `npm i bootstrap` – Joel Joseph Jun 28 '19 at 07:55

3 Answers3

2

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

Nisharg Shah
  • 16,638
  • 10
  • 62
  • 73
  • well, after comparison the code between yours and mine line by line I fount I just have a extra comma after` "src/styles.css"` , that's too stupid... – Shinji035 Jun 28 '19 at 14:05
  • yep, this small mistakes are creates huge problem and waste much time :D – Nisharg Shah Jun 28 '19 at 15:37
0

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

djnose
  • 917
  • 7
  • 19
0

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",
          ],
     }  
  }
}
Duy Đoàn
  • 99
  • 3