angular.module(‘myApp.services‘).factory(‘Entry‘, function($resource) {
return $resource(‘/api/entries/:id‘); // Note the full endpoint address
});
之后 Entry 就会有如下方法
get()
query()
save()
remove()
delete()
然而现在的项目api 并不是靠verb来区分crub的
所以这部分我是自己写的
原文:http://www.cnblogs.com/AlexNull/p/5988849.html