【发布时间】:2014-08-31 03:38:05
【问题描述】:
由于某种原因,当我更新表单并尝试清空该字段(在此示例中为“描述”)时,传递到服务器的值是原始值。
例如,如果description 的值为“description here”,然后我将表单上的值清空,则客户端显示description 字段的未定义。在 $update (ng-resource) 之后,服务器端的值是原始值。
// when it gets to the server side, foo.description is filled in with the original value
// after trying to blank it out
foo.$update(function() {
$location.path('foo/' + $scope.foo._id);
}, function(errorResponse) {
$scope.error = errorResponse.data.message;
});
客户端的Here is the plunkr。
【问题讨论】:
标签: angularjs ngresource