0
I have a grid where on each line there is a button to delete the corresponding data. This grid is powered by a json but there is no id. I wonder how I could delete the selected object, being that the grid is being fed by an ng-repeat and to delete a data I have to take the click, remove the item from the array and give a post with all the data to the server back.
Follow 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) {});
}