首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >amcharts4未使用angular 6进行编译

amcharts4未使用angular 6进行编译
EN

Stack Overflow用户
提问于 2018-11-22 00:18:44
回答 1查看 2.7K关注 0票数 5

当包含amcharts4时,我在编译我的应用程序时遇到了问题。我只是简单地安装了amcharts4 npm包,并尝试在我创建的组件中使用它。我是否遗漏了CLI配置中的某些内容?

代码语言:javascript
复制
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'.

我的打字稿:

代码语言:javascript
复制
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 {

}
EN

回答 1

Stack Overflow用户

发布于 2019-02-21 17:00:07

使用忽略typescript代码中错误的@ts-ignore表示法:

代码语言:javascript
复制
// @ts-ignore
import * as am4core from "@amcharts/amcharts4/core";

// @ts-ignore
import * as am4charts from "@amcharts/amcharts4/charts";

并将typescript版本更新为最新版本:

代码语言:javascript
复制
npm install typescript@next --save

对我来说是:"typescript": "^3.4.0-dev.20190220"

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53416341

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档