Angular 5 with Bootstrap 4 not working

后端 未结 7 743
粉色の甜心
粉色の甜心 2021-02-04 18:50

I created a new Angular 5 project. After that I followed instructions given on Angular CLI GitHub page to use Bootstrap 4.0.0 with Angular 5.2.2. I use \'npm install bootstrap\'

7条回答
  •  春和景丽
    2021-02-04 19:47

    npm install bootstrap --save

    Open .angular-cli.json or angular.json file and update script section as shown in above answers. Also add it to styles array:

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

    If this doesn't work, then open src\styles.css and add:

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

提交回复
热议问题