How do I add 1 item to a json object in angularJS.
In case I have: {COD: 29, MOTIVO: "teste"}
And I'd like you to stay: {COD: 29, MOTIVO: "teste", ID : 12345789}
Home
I tried the following:
$scope.cadastroSolicitacao = function(values){
$scope.v = values;
$scope.v.push({MATRICULA : '123456789'})
//console.log($scope.v);
};
In the above case, when I clicked on the button that contains the form it would execute the function cadastroSolicitacao
get the values of it and add this item MATRICULA
, but did not succeed.