I have an array inside an Object which looks like this.
sourceSystemArray = [{
"attId" : 2257,
"attributeName" : "country",
"attributeValues" : [ "AU", "KG", "IN", "AF" ]
}]
Using input field I give user option to add a new Value.
Now I would like to finally add the New Input value that I get using ngModel to attributeValues array.
So suppose user enters a new Country say NZ.
So I want to push NZ to attributeValues and my final Object should like this:
sourceSystemArray = [{
"attId" : 2257,
"attributeName" : "country",
"attributeValues" : [ "AU", "KG", "IN", "AF","NZ" ]
}]
I tried using push method but it's not working. Can someone help me figure out how to achieve it.
attributeValues????[0].attributeValues.push(something)... where???is the name of the variable that contains that Array you posted