简体   繁体   中英

NgbModule ng-bootstrap for angular2 not working

Imported it in app.module.ts like,

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

Added it in:

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'

While compiling its says this, what is wrong with my code?

I waste time to resolve this issue from version of Angular. Do steps below:

  1. Uninstall your current @ng-bootstrap : npm uninstall @ng-bootstrap/ng-bootstrap
  2. Change this line in package.json : "@ng-bootstrap/ng-bootstrap": "1.0.0-alpha.24"
  3. Run: npm install

Please update into Latest Version of Angular CLI, then you won't get this error, I tried it, its working fine.

https://cli.angular.io/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM