我得到了下面這個使用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();
}
不知道
更多細節,但它可能是值得看看下面的盤ussion:https://groups.google.com/d/msg/angular/_LRK9h9j-Yg/ZmOkv-uhVcAJ – Tosh