我使用角度为js的restangular。 get()和post()运行良好。但是放不行。这是代码 -
$scope.submitFunction = function(isValid) {
if (isValid) {
$scope.post = {};
$scope.post.id = $scope.form.id;
$scope.post.code = $scope.form.code;
$scope.post.description = $scope.form.description;
Restangular.one('manufacturing/process', $scope.processId). get(). then( function(response1) {
$scope.post.version = response1.data.version;
$scope.post.put().then(function(response) {
alert('updated');
}, function(response) {
alert('error);
});
}, function(response1) {
alert('error);
});
}
};
它给了我error = $scope.post.put is not a function
答案 0 :(得分:0)
,对象$ scope.post引用跟随对象
$scope.post = {};
而不是你的矩形休息服务。