angular 7+ ionic 4无法绑定到“数据集”,因为它不是“ canvas”的已知属性

时间:2019-04-09 04:12:08

标签: angular7 ionic4 ng2-charts

尝试在Angular 7和ionic 4中使用ng2-charts时出现错误。

package.json:

"dependencies": {
    "@angular/common": "^7.2.2",
    "@angular/core": "^7.2.2",
    "@angular/forms": "^7.2.2",
    "@angular/http": "^7.2.2",
    "@angular/platform-browser": "^7.2.2",
    "@angular/platform-browser-dynamic": "^7.2.2",
    "@angular/router": "^7.2.2",
    "@ionic-native/core": "^5.0.0",
    "@ionic-native/splash-screen": "^5.0.0",
    "@ionic-native/status-bar": "^5.0.0",
    "@ionic/angular": "^4.1.0",
    "chart.js": "^2.8.0",
    "ng2-charts": "^2.2.2",
    "rxjs": "~6.3.3",
    "zone.js": "^0.8.29"
  },

app.module.ts:

import { ChartsModule } from 'ng2-charts';
...
  imports: [
    BrowserModule,
    IonicModule.forRoot(),
    AppRoutingModule,
    HttpClientModule,
    ChartsModule
  ],

任何提示都会有所帮助。谢谢!

0 个答案:

没有答案