I am trying to send the ID of element to nodejs api using angularjs $resource delete method, The value is sending as parameter value how can I send that value as a body parameter?
my code is like this
In angularjs
var ids = {
delId : row._id
}
$resource('/deleteUser').delete(ids,function(data){
alert(data)
});
In nodejs
app.delete('/deleteUser', function(req, res) {
console.log('called');
var resp = {
success : true,
id : req.body.id
}
console.log(req)
res.json(resp)
});
But Its sending only success in the response ignoring id value, How can it be done?