-1
我有一个下拉使用angularjs,但在初始加载它显示'没有选择',我想选择第一个值默认。angularjs下拉显示没有选择时加载第一次
<select id="cbo-db-selection" ng-init="selectedlibrary=selectedlibrary[0].value" ng-model="selectedlibrary" required="required" ng-options="opt.DatabaseName as opt.DatabaseName for opt in DBLibraries">
<option style="display:none" value="">{{selectedlibrary}}</option>
</select>
我想这篇文章可以帮助你:[这里](http://stackoverflow.com/questions/18194255/how-to-have-a-default-option -in-select-box-angular-js) 你必须使用ng-init –