I have a grid where in each row there is a button to delete the corresponding data. This grid is fed by a json but there is no id. I would like to know how I could do to delete the selected object, the grid being fed by a ng-repeat and to delete a given I have to get the click, remove the item from the array and give a post with all the data to the server back.
Here's what I'm trying to do (and it's not working)
ng.remover = function(liberados){
var ind;
allow.url.forEach(function (lib, i){
if(liberados == lib){
ind = i;
}
});
allow.url.splice(1,ind);
var allowCopied = angular.copy(allow);
allowCopied.name = allowCopied.url;
ng.tudo.allowedSitesList.push( allowCopied );
$http({method: "POST", url: "http://localhost:0000/in", data: ng.tudo})
.then(function (dados) {});
}