-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 –