I know that HTML does not support anything other than POST and GET.
I have a app that works when I send a DELETE request via POSTMAN. But when I try with ng-submit or ng-click that calls a function delete, it does not work.
How can I achive this delete request in-code ? Is that possible to create a button that does a DELETE request ? I am using AngularJS.
This is what I have created: (index.html)
<md-button ng-click="delete()">Delete everything.</md-button>
This is the app.js that calls the function delete:
$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");
}
});
};