简体   繁体   English

grunt undefined方法错误?

[英]grunt undefined Method error?

I have an Angular App that uses grunt to build and minify. 我有一个使用Grunt构建和缩小的Angular应用程序。 I have imported one library in index.html like this: <script type="text/javascript"> java script code </script> between the header tag. 我已经在index.html中导入了一个库,如下所示:标头标记之间的<script type="text/javascript"> java script code </script> It is supposed to make the methods of that library globally available though my application. 应该通过我的应用程序使该库的方法全局可用。 The problem is that when I run grunt to build my application, grunt doesn't recognize the method of that library. 问题是,当我运行grunt构建应用程序时,grunt无法识别该库的方法。 What should I do to fix it? 我该怎么解决? The error I get in grunt is: 'the method I used' is undefined. 我抱怨的错误是:“我使用的方法”未定义。

Use /* global name of the method* / at the top of the file where grunt gives you undefined error. 在文件顶部(如果grunt给您未定义的错误)使用/ * 方法的全局名称* /。 it will make that method globally available. 它将使该方法在全球范围内可用。 so you don't need to be worried about it. 因此您无需担心。

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

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