簡體   English   中英

用於angular2的NgbModule ng-bootstrap不起作用

[英]NgbModule ng-bootstrap for angular2 not working

將其導入到app.module.ts中,例如

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

在以下位置添加:

imports:[NgbModule.forRoot()]

./~/@ng-bootstrap/ng-bootstrap/datepicker/datepicker-input.js 188中的警告:“在'@ angular / core'中找不到導出'Renderer2'

在./~/@ng-bootstrap/ng-bootstrap/modal/modal-window.js中警告61:12-21“在'@ angular / core'中找不到導出'Renderer2'

./~/@ng-bootstrap/ng-bootstrap/popover/popover.js中的警告119:12-21“在'@ angular / core'中找不到導出'Renderer2'

./~/@ng-bootstrap/ng-bootstrap/buttons/radio.js中的警告108:12-21“在'@ angular / core'中找不到導出'Renderer2'

在編譯其內容時,我的代碼有什么問題?

我浪費時間從Angular版本解決此問題。 請執行以下步驟:

  1. 卸載當前的@ng-bootstrapnpm uninstall @ng-bootstrap/ng-bootstrap
  2. 更改package.json此行: "@ng-bootstrap/ng-bootstrap": "1.0.0-alpha.24"
  3. 運行: npm install

請更新到最新版本的Angular CLI,然后您將不會收到此錯誤,我嘗試過,它可以正常工作。

https://cli.angular.io/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM