NgbModule ng-bootstrap for angular2 is not working

ぃ、小莉子 提交于 2020-01-05 07:03:26

问题


Imported it in app.module.ts like,

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

added it in

imports:[NgbModule.forRoot()]

while compiling it is giving

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.

What could be wrong with the initialization, can anyone help? Thank you.


回答1:


I was using

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

which is not compatible with angular 2.4.0

tried using 1.0.0-alpha.24 as @yurzui suggested and it is working now.




回答2:


I am using "ng2-bootstrap": "1.1.16", with my Angular 2.4 version and it is working fine. Try that one.



来源:https://stackoverflow.com/questions/44062698/ngbmodule-ng-bootstrap-for-angular2-is-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!