我正在使用Angular JS,我需要使用angular JS设置下拉列表控件的选定选项。如果这很荒谬,请原谅我,但我是Angular JS的新手
这是我的html的下拉列表控件
<select ng-required="item.id==8 && item.quantity > 0" name="posterVariants"
ng-show="item.id==8" ng-model="item.selectedVariant"
ng-change="calculateServicesSubTotal(item)"
ng-options="v.name for v in variants | filter:{type:2}">
</select>
填充后,我得到
<select ng-options="v.name for v in variants | filter:{type:2}" ng-change="calculateServicesSubTotal(item)"
ng-model="item.selectedVariant" ng-show="item.id==8" name="posterVariants"
ng-required="item.id==8 && item.quantity > 0" class="ng-pristine ng-valid ng-valid-required">
<option value="?" selected="selected"></option>
<option value="0">set of 6 traits</option>
<option value="1">5 complete sets</option>
</select>
如何设置value="0"
要选择的控件?
<option value="0" ng-selected="true">set of 6 traits</option>