最初我的下拉列表默认有一个空白选项,我想更改此选项的文本。我怎么能这样做?
<body ng-controller="controller">
<span>Options: </span>
<select ng-options="item as item.name for item in regions track by item.code" ng-model="select">
</select>
</body>
答案 0 :(得分:2)
<select ng-options="item as item.name for item in regions track by item.code" ng-model="select">
<option value="">Text Goes Here</option>
</select>
一旦使用
选择了某些内容,您也可以隐藏该选项<option ng-if="!select" value="">Text Goes Here</option>