最近在一个angular项目中使用ng-bootstrap,初步入门,所以记录一下。
什么是ng-bootstrap
概念:基于Angular 的 Bootstrap组件
构架:TypeScript+bootstrap 4 CSS框架
特点:其API在Angular是可用的,不需要第三方js
如何使用ng-bootstrap
1.全局安装ng-bootstrap
npm install --save @ng-bootstrap/ng-bootstrap
2.在angular项目中引入module
//app.module.ts
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
@NgModule({
declarations: [
AppComponent
],