且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

角JS未知提供商

更新时间:2023-01-18 23:01:02

您code看起来不错,其实它的工作原理(除了电话本身)复制和放大器时;粘贴到一个样品的jsfiddle: http://jsfiddle.net/VGaWD/

Your code looks good, in fact it works (apart from the calls themselves) when copied & pasted into a sample jsFiddle: http://jsfiddle.net/VGaWD/

很难说是怎么回事,没有看到一个更完整的例子,但我希望以上的jsfiddle会有所帮助。 什么,我怀疑的是,你不与'productServices模块初始化您应用。这将给予同样的错误,我们可以在其他的jsfiddle看到这一点: http://jsfiddle.net/a69nX/1/

Hard to say what is going on without seeing a more complete example but I hope that the above jsFiddle will be helpful. What I'm suspecting is that you are not initializing your app with the 'productServices' module. It would give the same error, we can see this in another jsFiddle: http://jsfiddle.net/a69nX/1/

如果您计划使用AngularJS和MongoLab的我会建议使用现有的适配器为$资源和MongoLab 以工作:https://github.com/pkozlowski-opensource/angularjs-mongolab
它简化了大部分的疼痛MongoLab工作的,你可以看到它在这里的行动:http://jsfiddle.net/pkozlowski_opensource/DP4Rh/
免责声明!我维持这种适配器(基于AngularJS的例子写的),所以我在这里很明显偏向。

If you are planning to work with AngularJS and MongoLab I would suggest using an existing adapter for the $resource and MongoLab: https://github.com/pkozlowski-opensource/angularjs-mongolab It eases much of the pain working with MongoLab, you can see it in action here: http://jsfiddle.net/pkozlowski_opensource/DP4Rh/ Disclaimer! I'm maintaining this adapter (written based on AngularJS examples) so I'm obviously biased here.