I need to pass an array object as follows, to api:
[paulo = 1, gustavo = 2, amanda = 3,...]
I have the following code:
$scope.salvarHabilidades = function(pro){
var valores = pro.filter(function(o,i){
return o.habilidades == true;
});
var habi = new Array();
for(var i = 0; i < valores.length; i++){
console.log(valores[i]);
habi = [(valores[i].descricao = valores[i].idhabilidade)];
}
habi.idusuario = $rootScope.idPro;
console.log(habi);
}
Because what appears in the console of the line "console.log (values [i])" is this:
Followtheselectionscreen: