I created the following array:
$scope.testAccounts[0] = { id: 99, name: "Select Account" };
I tried
$scope.testAccounts.push(result.data);
where results.data looks something like this:
[{ id: 1, name: "x" },{ id: 2, name: "y" }]
However this does not seem to work as it tries to add an array as the second element. What I need is to have the contents of the array result.data appended to the array $scope.testAccounts
Please note that all the examples I have seen so far seem to not work if the array is an array of objects. This is what I have. Thanks