1

所以我想用下面的项目试试 Chat.js。

https://github.com/mraible/jhipster4-demo

所以我研究并发现了以下内容http://valor-software.com/ng2-charts/

所以我安装了 ng-2 图表。ng2-charts 需要 chart.js,所以我也安装了 chart.js,我可以在 jhipster4-demo 项目的 node_modules 下看到它。

ng2图表说

Embedding Chart.js in application is mandatory!

<script src="node_modules/chart.js/src/chart.js"></script>

在 jhipster4-demo 项目中如何进行上述强制步骤?因为我不是 webpack 专家,所以不知道该怎么做。

4

1 回答 1

5

将您的库导入src/main/webapp/app/vendor.ts

import 'chart.js/src/chart.js';

这也是在 Matt Raible 的演示应用程序中生成的README.md文件的“管理依赖项”部分中解释的内容。

于 2017-03-12T10:03:51.623 回答