我有默认值作为第一个值的下拉框。但是当我在下拉列表中选择任何其他值时,下拉框中的值保持为默认值。
<select ng-init="searchParams.countPerPage = perPageValues[0].val" ng-model="searchParams.countPerPage" ng-options="item.val as item.val for item in perPageValues | orderBy :'sequence'" ng-change="track('perPageChange')" data-id="select-per-page"> </select>
此代码产生:
<select ng-init="searchParams.countPerPage = perPageValues[0].val" ng-model="searchParams.countPerPage" ng-options="item.val as item.val for item in perPageValues | orderBy :'sequence'" ng-change="track('perPageChange')" data-id="select-per-page" class="ng-pristine ng-valid">
<option value="0" selected="selected">25</option>
<option value="1">50</option>
<option value="2">100</option>
</select>