如何解决与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 举报,一经查实,本站将立刻删除。