在首先使用工作网站上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依赖
- 为什么Restangular不依赖于lodash /下划线 lodash之间
- 差异凸显
- Restangular Dependencies
- Why Does Restangular Depend on lodash / underscore
- Differences between lodash and underscore
更多推荐
错误:无法实例化模块restangular原因是:“
发布评论