与Angular一起使用Plotly

问题描述

我有一个简单的Angular项目,以学习如何在最新的Angular中使用Plotly。运行ng serve显示如下:

** Angular Live Development Server is listening on localhost:4200,open your browser on http://localhost:4200/ **

Date: 2020-08-11T20:30:09.702Z
Hash: 4d3096aeaa7aa502b570
Time: 5526ms
chunk {es2015-polyfills} es2015-polyfills.js,es2015-polyfills.js.map (es2015-polyfills) 285 kB [initial] [rendered]
chunk {main} main.js,main.js.map (main) 1.9 kB [initial] [rendered]
chunk {polyfills} polyfills.js,polyfills.js.map (polyfills) 93.2 kB [initial] [rendered]
chunk {runtime} runtime.js,runtime.js.map (runtime) 6.08 kB [entry] [rendered]
chunk {scripts} scripts.js,scripts.js.map (scripts) 3.26 MB [entry] [rendered]
chunk {styles} styles.js,styles.js.map (styles) 16.3 kB [initial] [rendered]
chunk {vendor} vendor.js,vendor.js.map (vendor) 329 kB [initial] [rendered]

ERROR in node_modules/angular-plotly.js/src/app/plotly-via-cdn/plotly-via-cdn.module.d.ts(9,16): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/angular-plotly.js/src/app/plotly-via-cdn/plotly-via-cdn.module.d.ts(10,16): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/angular-plotly.js/src/app/shared/plotly.service.d.ts(11,9): error TS1086: An accessor cannot be declared in an ambient context.

Failed to compile.

应用程序模块:

import { PlotlyModule } from 'angular-plotly.js';
PlotlyModule.plotlyjs = PlotlyJS;

同时尝试了PlotlyViaWindowModule和PlotlyViaCDNModule。

感谢帮助。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)