简体   繁体   English

ReferenceError:在角度2.00 rc4中未定义nv

[英]ReferenceError: nv is not defined in angular 2.00 rc4

I am using ng2-nvd3 chart control in my angular 2 application (2.00 rc4) But the following error is occuring when loading the page: 我在我的angular 2应用程序(2.00 rc4)中使用ng2-nvd3图表控件,但是在加载页面时发生以下错误:

ReferenceError: nv is not defined ReferenceError:未定义nv

Seems your JS are not in order, make sure to load them in following order. 似乎您的JS顺序不正确,请确保按以下顺序加载它们。

 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.8.4/nv.d3.min.css"/>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js" charset="utf-8"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.8.4/nv.d3.min.js"></script>

Load them up in index.html, before your system.js.config loading. 在加载system.js.config之前,将它们加载到index.html中。

Plunkr : http://plnkr.co/edit/T4i7Zh?p=preview Plunkr: http ://plnkr.co/edit/T4i7Zh?p = preview

Make sure, you have included these libraries in exactly this order: 确保您完全按照以下顺序包含了这些库:

d3.min.js nv.d3.min.js ng2-nvd3.ts Also, you can try to add the first two libraries to your index.html to determine if you have an import error: d3.min.js nv.d3.min.js ng2-nvd3.ts另外,您可以尝试将前两个库添加到index.html中以确定是否有导入错误:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM