0
我知道HTML不支持除POST和GET以外的任何其他功能。用HTML刪除請求 - AngularJS?
我有一個應用程序,當我通過POSTMAN發送DELETE請求時工作。但是,當我嘗試使用ng-submit或ng-click來調用函數delete時,它不起作用。
如何在代碼中完成此刪除請求?有可能創建一個執行DELETE請求的按鈕嗎?我正在使用AngularJS。
這是我創造(的index.html)
<md-button ng-click="delete()">Delete everything.</md-button>
這是調用該函數刪除app.js:
$scope.delete = function(index) {
var data = {
"id" : $scope.pollData[index].id,
"option" : $scope.pollData[index].selected
};
$http.delete("/polls",data).success(function(response) {
if(response.responseCode === 0) {
console.log("Success");
console.log("IvanUspeh");
$scope.hiddenrows.push(index);
} else {
console.log("error");
}
});
};
訪問PARAMS看到這個問題http://stackoverflow.com/questions/22055251/how-to-send-data-with-angularjs-http-delete -請求 –