This situation may seem odd, but I am willing to adjust the API Data if necessary.
My requirement is to have multiple dropdowns sharing the same ng-model.
The Question:
- Why does
ng-model
become unique when using the same variable name? How can I ensure that each drop down shares one
ng-model="selectedSize"
<div ng-repeat="(key, val) in listing.colors_and_sizes.data" > <p>{{selectedSize}}</p> <input ng-checked="selected" type="radio" name="colors" ng-model="selected.pdw.color" ng-value="key"/> <select ng-model="selectedSize" ng-options="choice as choice for (idx, choice) in val.sizes.split(',')" ng-change="selected.product.set.size(key,val, selectedSize);"> <option value="">Please select a size</option> </select> </div>