amcharts4没有用angular 6编译
发布时间:2020-12-17 17:12:02 所属栏目:安全 来源:网络整理
导读:我在包含amcharts4时编译我的应用程序时遇到问题.我只是安装了amcharts4 npm软件包,并尝试在我创建的组件中使用它.我错过了CLI配置的东西吗? ERROR in node_modules/@amcharts/amcharts4/.internal/core/utils/Object.d.ts(60,117): error TS2536: Type 'Ke
我在包含amcharts4时编译我的应用程序时遇到问题.我只是安装了amcharts4 npm软件包,并尝试在我创建的组件中使用它.我错过了CLI配置的东西吗?
ERROR in node_modules/@amcharts/amcharts4/.internal/core/utils/Object.d.ts(60,117): error TS2536: Type 'Key' cannot be used to index type 'Object'. node_modules/@amcharts/amcharts4/.internal/core/utils/Object.d.ts(67,109): error TS2536: Type 'Key' cannot be used to index type 'Object'. node_modules/@amcharts/amcharts4/.internal/core/utils/Object.d.ts(76,116): error TS2536: Type 'Key' cannot be used to index type 'Object'. node_modules/@amcharts/amcharts4/.internal/core/utils/Type.d.ts(25,32): error TS2304: Cannot find name 'Extract'. 我的打字稿: import { Component,NgZone } from "@angular/core"; import * as am4core from "@amcharts/amcharts4/core"; import * as am4charts from "@amcharts/amcharts4/charts"; import am4themes_animated from "@amcharts/amcharts4/themes/animated"; am4core.useTheme(am4themes_animated); @Component({ selector: 'app-am-charts',templateUrl: './am-charts.component.html',styleUrls: ['./am-charts.component.css'] }) export class AmChartsComponent { } 解决方法
根据
this issue
this newer closed issue和我们的
angular integration documentation,请确保您的tsconfig.json中包含以下内容,因为AmCharts 4当前不支持严格模式:
{ "compilerOptions": { "strictNullChecks": false,"strictFunctionTypes": false } } 除此之外,请确保您至少使用TypeScript版本2.7 2.8但不支持3.x,因为它尚不支持. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |