How to pass an array in a set of objects using AngularJs


I have this array:


and I want to push this another $scope.Address array into the first(index) object and the output should be like this:


When I tried to push the address into the array it is creating a new object, so I tried this:


But it's showing this error: "[0] is undefined"

I think you are looking for this

$scope.arrayList[0].Address= $scope.Address;

you can not insert array into an array of object without giving key/value pair.

Assuming $scope.Address stores an array of addresses for the $scope.arrayList[0].

If that is not the case and you want to map each array with respect to the index, then try this:

$scope.arrayList[0].Address= $scope.Address[0];