我得到了以下使用GET的示例..但是'doSave'不能用于POST。 我忽略了一些吗?
$scope.obj1 = $resource('http://localhost:port/srv/:id',
{port: '\:8080', id:'2', callback: 'JSON_CALLBACK'},
{get:{method:'JSONP'}, save:{'POST'});
$scope.doSearch = function () {
$scope.Result = $scope.obj1.get({id:$scope.term});
}
$scope.doSave = function () {
$scope.Result.save();
}
答案 0 :(得分:1)
除了查询/获取方法之外,其余的都被称为前缀为$($ resource。$ save(),$ resource。$ remove()等)
所以在doSave中你需要
$scope.Result.$save();
中的更多详细信息