javascript 我收到此错误“无模块:ngResource”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14631749/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
I am getting this error "No module: ngResource"
提问by Trip
Trying to use the Angular $resource, and its coming back as not a method. Looking through the sparse documentation, I was able to find this :
尝试使用 Angular $resource,但它又不是一种方法。查看稀疏文档,我能够找到这个:
angular.module('productServices', ['ngResource']).
That you're supposed to include it in your app module. Fair enough, I throw it in and get :
您应该将它包含在您的应用程序模块中。很公平,我把它扔进去并得到:
Uncaught Error: No module: ngResource
Hmm.. does this not come with Angular.js and its a separate plugin?
嗯..这不是随 Angular.js 及其单独的插件一起提供的吗?
回答by Donut
It's a separate file that you'll need to include in your project, as of version 1.0.0rc3 (see changelog on GitHub).
从 1.0.0rc3 版本开始,它是一个单独的文件,您需要将其包含在您的项目中(请参阅 GitHub 上的更改日志)。
Head over to http://code.angularjs.org-- under the folder for any version after this release, you should see the angular-resource.js
file available for download and inclusion in your project.
转到http://code.angularjs.org—— 在此版本之后的任何版本的文件夹下,您应该会看到angular-resource.js
可供下载并包含在您的项目中的文件。