要设置空值,这是控制器-
function display($scope) { $scope.obj ={"selected":null}; $scope.objects = [{id: 1, value: "Yes"}, {id: 0, value: "No"}] }
以下是模板-
<div ng-controller = "display"> <select ng-model = "obj.selected" ng-options = "value.id as value.value for value in objects"> <option value = "">Unknown</option> </select> <br/> {{obj}} </div>