将其导入到 app.module.ts 中,例如,
import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
添加到:
imports:[NgbModule.forRoot()]
WARNING in ./~/@ng-bootstrap/ng-bootstrap/datepicker/datepicker-input.js 188:12-21 "export 'Renderer2' was not found in '@angular/core'
WARNING in ./~/@ng-bootstrap/ng-bootstrap/modal/modal-window.js 61:12-21 "export 'Renderer2' was not found in '@angular/core'
WARNING in ./~/@ng-bootstrap/ng-bootstrap/popover/popover.js 119:12-21 "export 'Renderer2' was not found in '@angular/core'
WARNING in ./~/@ng-bootstrap/ng-bootstrap/buttons/radio.js 108:12-21 "export 'Renderer2' was not found in '@angular/core'
编译时这样说,我的代码有什么问题吗?
最佳答案
我浪费时间从 Angular 版本解决这个问题。执行以下步骤:
- 卸载当前的
@ng-bootstrap
:npm uninstall @ng-bootstrap/ng-bootstrap
- 在
package.json
中更改此行:"@ng-bootstrap/ng-bootstrap": "1.0.0-alpha.24"
- 运行:
npm install
关于javascript - Angular2 的 NgbModule ng-bootstrap 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44352563/