I have an array containing multiple objects in JSON, as well as a select element that contains an array. Depending on the selection made in the first array, another select box will be dynamically loaded right below it.
HTML Code
<div class="list">
<label class="item item-input item-select col col-50">
<div class="input-label">
Month
</div>
<select class="select-estado"
ng-model="selectedMonth"
ng-options="months.month for months in monthArray">
<option value="">Select a month</option>
</select>
</label>
</div>
<div class="list">
<label class="item item-input item-select col col-50">
<div class="input-label">
State
</div>
<select name="states" class="select-estado"
ng-model="selectedState"
ng-options="selectedMonth.states as states.state for states in selectedMonth.states">
<option value="">Select a state</option>
</select>
</label>
</div>
Issue
Whenever I choose 2 in the select box, the generated array always selects the last element: /
Does anyone have any idea why this might be happening?