【发布时间】:2014-11-27 09:29:40
【问题描述】:
我正在使用带有 Angular js 的 restangular。 get() 和 post() 运行良好。但是 put 不起作用。这是代码 -
$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);
});
}
};
它给了我错误 = $scope.post.put is not a function
【问题讨论】:
-
找到任何解决方案了吗?
标签: angularjs angularjs-directive angularjs-scope restangular