我已经关注了网站上的所有内容:http://valor-software.com/ng2-charts/

  • npm install ng2-charts --save

  • npm install chart.js --save

然后我在HTML中添加了这个脚本链接:

<script src="node_modules/chart.js/dist/Chart.bundle.js"></script>

接下来我添加了我的import语句:

enter image description here

由于import语句,我现在在zone.js代码中抛出一个错误 .

GET http:// localhost:3000 / ng2-charts 404(Not Found)zone.js:2019

这是导入ng2图表的正确方法吗?或者我错过了什么 . 我对angular2很新 .