I have set up the following resource, function and cell template:
var Exam = $resource('/api/Tests', {}, {
saveData: { method: 'PUT' }
});
$scope.delete = function (row) {
row.entity.$delete(row.examId);
}
$scope.updateEntity = function (column, row) {
console.log(row.entity);
console.log(column.field);
row.entity.$saveData();
}
{ field: '', cellTemplate: '<button ng-click="delete(row)">Delete</button>' }
However I find that it is only sending:
DELETE /api/Tests HTTP/1.1
Is there a way I can change the resource so that if the row testId is equal to one then it correctly sends
DELETE /api/Tests/1
Note that I already tried the following but it still sends the same URL to my server:
row.entity.$delete(row.entity.testId)
One more thing. My updateEntity works and sends a put along with a json of the row