angular2的NgbModule ng-bootstrap不起作用

时间:2017-05-19 06:16:17

标签: angular ng-bootstrap

在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'

WARNING in ./~/@ng-bootstrap/ng-bootstrap/buttons/radio.js
212:12-21 "export 'Renderer2' was not found in '@angular/core'

WARNING in ./~/@ng-bootstrap/ng-bootstrap/typeahead/typeahead.js
224:12-21 "export 'Renderer2' was not found in '@angular/core'

WARNING in ./~/@ng-bootstrap/ng-bootstrap/tooltip/tooltip.js
131:12-21 "export 'Renderer2' was not found in '@angular/core'
webpack: Compiled with warnings.

初始化可能有什么问题,有人可以帮忙吗? 谢谢。

2 个答案:

答案 0 :(得分:4)

我正在使用

@ng-bootstrap/ng-bootstrap 1.0.0-alpha.26 

与角度2.4.0不兼容

尝试使用1.0.0-alpha.24作为@yurzui建议,现在正在使用。

答案 1 :(得分:-1)

我正在使用“ng2-bootstrap”:“1.1.16”,我的Angular 2.4版本正常运行。试试那个。