在项目实践中遭遇select不能用selected="selected"设定默认的值,随查询解决办法:
$scope.optionArray = [{"key":"王钢蛋","value":"0"},{"key":"赵铁锤","value":"1"},{"key":"楼主","value":"2"}]$scope.selectOption = $scope.optionArray[0] //初始化值,默认加载这个值;--------------------------------------------------------------------------
<select ng-model="selectOption" ng-option="option.key for option in optionArray"></select>