1
只需在Angular中设置一个默认的选定值,但到目前为止我没有运气。使用ng-init默认选定的值不起作用
HTML编译之前:
<select ng-options="select.Value as select.Name for select in ruleSelect" ng-model="rule.MatchLogic" ng-init="rule.MatchLogic = 0" ></select>
HTML在浏览器中来源:
<select ng-options="select.Value as select.Name for select in ruleSelect" ng-model="rule.MatchLogic" class="ng-pristine ng-valid">
<option value="?" selected="selected"></option>
<option value="0">All</option>
<option value="1">At Least</option>
<option value="2">At Most</option>
</select>
如何使值= 0(所有)的默认选定值。