错误:无法实例化模块restangular原因是:“_”未定义 [英] Error: Failed to instantiate module restangular due to: '_' is undefined
问题描述
在首先使用工作网站上Restangular我得到了以下JavaScript错误:
When first using Restangular on a working website I got the following JavaScript error:
未能实例化模块restangular原因是:_未定义
Failed to instantiate module restangular due to: '_' is undefined
我在想什么?这是什么意思是'_'是不确定的(在Restangular模块)?
What am I missing? What does it mean that '_' is undefined (in the Restangular module)?
推荐答案
这是一个简单的监督。该_(下划线)是Restangular使用和依赖于一个JavaScript工具库。包括 Lodash 或 Undrescore 的AngularJS库之前库(在你的HTML):
It's a simple oversight. The '_' (underscore) is a JavaScript utility library that Restangular uses and depends on. Include Lodash or Undrescore library before the AngularJS library (in your HTML):
<script src="lodash.js"></script>
或
<script src="underscore.js"></script>
PS:仔细检查库脚本和路径存在在你的脚本标记引用
PS: Double check the library script and path exist as referenced in your SCRIPT tag.
其他读数:
- Restangular Dependencies
- Why Does Restangular Depend on lodash / underscore
- Differences between lodash and underscore
这篇关于错误:无法实例化模块restangular原因是:“_”未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!