amcharts4未使用角度6进行编译

use*_*567 5 amcharts angular

包含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'.
Run Code Online (Sandbox Code Playgroud)

我的打字稿:

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 {

}
Run Code Online (Sandbox Code Playgroud)

xor*_*ark 1

根据这个问题 这个较新的已关闭问题和我们的角度集成文档,请确保您的 tsconfig.json 中有以下内容,因为 AmCharts 4 目前不支持严格模式:

{
    "compilerOptions": {
        "strictNullChecks": false,
        "strictFunctionTypes": false
    }
}
Run Code Online (Sandbox Code Playgroud)

除此之外,请确保您至少使用 TypeScript 版本2.7 2.8,但不是 3.x,因为尚不支持它。