This is my list in the controller:
vm.areaList.push({"areaId":"101","areaName":"A","subAreaNames":["AA","BB"
,"CC","DD","EE","FF","GG","HH"]});
vm.areaList.push({"areaId":"102","areaName":"B","subAreaNames":["II","JJ" ]});
vm.areaList.push({"areaId":"103","areaName":"Administration","subAreaNames":["KK","LL","MM"]});
And this is the first dropdown on my html page:
<select multiple="multiple" data-ng-options="area.areaId as area.areaName for area in AreaReportCtrl.areaList"
data-ng-model="AreaReportCtrl.selectedArea">
</select>
Based on the value selected from this dropdown I want to populate another dropdown with the corresponding sub-areas list.
Is it possible to keep the area and sub area data in single array ? If yes, how shall I iterate it in ng-options of the next dropdown based on the selected area? Or should I store the sub-area list in a different array by keeping a reference of the areaId ?
areaId
or when you change the area call a method and initialise the sub areas to another variable and the itterate with the newly assigned valueselect multiple
? are you wanting to aggregate all the possible sub-areas?