Trying to implement delete funtion in angularjs. The backend in asp.net is working fine. when i check with postman its working fine. now am trying to the front end for that. when i hit the delete button. its not getting the UId. its showing like this.
http://localhost:50802/api/User/BUser/[object%20Object]
am totally new to angular. i dont know whether this angular code is correct or not.And another thing is i need to implement user confirmation popup window also. please help me...
angular controller.
$scope.DeleteUser = function (data, UId) {
$http({
method: "post",
url: urls.api + 'User/BUser/' + UId,
data: JSON.stringify(data)
}).then(function (response) {
alert(response.data);
})
};
HTML
<tr ng-repeat="d in UserList">
<td>{{d.description}}</td>
<td>{{d.path}}</td>
<td><button ng-click="DeleteUser()">Delete </button></td>
</tr>
here my Asp.net Controller
[HttpDelete]
[Route("DeleteBanner/{UId}")]
public async Task<IHttpActionResult> DeleteBanner(int UId)
{
int? result = await _service.DeleteBannerAsync(UId);
return Ok();
}