尝试在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
],
任何提示都会有所帮助。谢谢!