Struggling to correctly insert an object in this format:
$scope.newObj = {1: "N/A", 2: "KO", 3: "OK", 4: "OK", 5: "OK", 15: "N/A", 19: "OK"}
An attempt was made using the following loop:
var objt = $scope.newObject;
console.log($scope.newObject[0]) // undefined
for(i=0;i<$scope.newObj.length;i++)
{
$http.post("insert?etat="+$scope.newObject[0]+"&id="+Object.keys(objt))
}
Unfortunately, it's not working as expected and displaying undefined
values. Any suggestions on how to fetch data from each row of the object and then pass it for insertion into the service?