Consider this code snippet:
var rows = [ '1', '2', '3', '4'];
// HTML table
<tr data-ng-repeat="record in rows()">
<td>
<select data-ng-model="dynamicInsurance[record]"
data-ng-options="dyn for dyn in onetwothreefour"
</select>
</td>
</tr>
This code will generate 4 rows with a select element in each. Let's say I choose different values from each of these dropdowns. If the dropdown displays the values:
one
two
three
four
And, if I select:
one from the first dropdown,
two from the second dropdown,
three from the third dropdown,
and four from the fourth dropdown,
After selecting these values, when I run the command
$scope.dynamicInsurance[1]
I receive one
My assumption was that all selected values would be stored in
$scope.dynamicInsurance
However, $scope.dynamicInsurance
only returns
Object : { 1 : "one" }
Any ideas on how to retrieve the entire set of values (i.e one, two, three, four)
from all the dropdowns?