angular的$resource factory都有啥
A factory which creates a resource object that lets you interact with RESTful server-side data sources.
后端需要体统RESTful的接口
利用query获取列表
$scope.tasklist = TasksServe.query({}, function(data) {
console.log(data);
});
利用get获取对象
$scope.task = TaskServe.get({ taskid: $routeParams.taskid }, function(data) {
console.log(data);
});
调用方式都差不多,get({/param/},callback)
Resource相关文章:
angularjs的resource实例对象