If I have this html-code:
<select multiple>
<option selected>
one
</option>
<option selected>
two
</option>
</select>
Then I see that by default both options are selected.
However, if I create the html through angular, then only the last element is selected:
<select
multiple
class="form-control"
ng-model="mymodel">
<option selected="selected" ng-repeat="item in myarr.units" value=" {{item.id}}">{{item.name}}</option>
</select>
When I look at the generated html I see:
<select class="form-control ng-pristine ng-untouched ng-valid ng-empty" multiple="" ng-model="mymodel">
<option selected="selected" ng-repeat="item in mymodel" value="2" class="ng- binding ng-scope">One</option>
<option selected="selected" ng-repeat="item in mymodel" value="3" class="ng-binding ng-scope">Two</option>
</select>
So both elements got a "selected" but only the last one is selected in GUI. Am I missing something?