NgbModule NG-引导的angular2不工作(NgbModule ng-bootstrap

2019-09-28 05:10发布

像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.

什么可能是错误的初始化,谁能帮助? 谢谢。

Answer 1:

我用

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

这是不具有角2.4.0兼容

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



Answer 2:

我使用“NG2的自举”:“1.1.16”,用我的角2.4版本,它是工作的罚款。 尝试之一。



文章来源: NgbModule ng-bootstrap for angular2 is not working