REST API를 사용하고 PUT 요청으로 프로젝트 개체를 업데이트하고 싶습니다. 요청은 API에서 지원되며 데이터를 PUT하기 위해 $ resource을 사용하려하지만 작동하지 않습니다. 여기에 내가 할 것입니다 : editedProject 웹 페이지에서 양식에 의해 작성 새로운 값으로 프로젝트이다
var projectResource = $resource('/api/projects/' + projectId, {update: {method: "PUT"}});
$scope.editProject = function(editedProject) {
projectResource.$update(editedProject);
}
. 내 projectResource 선언에 잘못된 것이 있다는 것을 알고 있지만 무엇을 찾지 못했습니다. 도와주세요!
[Angular $ resource update method not found] (http://stackoverflow.com)의 중복이 가능합니다./questions/14286713/angular-resource-update-method-not-found) – Stewie
무엇이 오류입니까? – Narretz
리소스를 선언하는 동안 다른 (두 번째 자리에) 인수를'{} '로 전달해야합니다. – Chandermani