angular6 中使用bootstrap

angular 安装ngx-bootstrap

npm install bootstrap --save

npm install --save @ng-bootstrap/ng-bootstrap

在style.scss中引入css

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

在app.module注入

import {NgbModule} from '@ng-bootstrap/ng-bootstrap';

imports: [
...
NgbModule,
 ...
],

在页面中使用

<button type="button" class="btn btn-primary">
  Single Button
</button>

效果:

原文地址:https://www.cnblogs.com/king94Boy/p/9669284.html