Angularjs 在ng选项中筛选时,下拉列表中的第一项为空

Angularjs 在ng选项中筛选时,下拉列表中的第一项为空,angularjs,ng-options,Angularjs,Ng Options,我在我的ng选项中过滤这是我在html中的代码 <select class="form-control" id="selectType" ng-model="user.type" ng-init="user.type= types[0]"> <option ng-repeat="type in types" value="{{type}}">{{type}}</option> </select> <select class="form

我在我的ng选项中过滤这是我在html中的代码

 <select class="form-control" id="selectType" ng-model="user.type" ng-init="user.type= types[0]">
 <option ng-repeat="type in types" value="{{type}}">{{type}}</option>
 </select>

<select class="form-control" ng-model="user.fullname" ng-options="employee as fullName(employee) for employee in employees | filter: user.type">
它将正确过滤,但在下拉列表的第一项中保留空白
我的结果是这样的

这是由于select的行为。如果要设置初始(非空)值,可以执行以下操作-

<select class="form-control" ng-model="user.fullname"
ng-options="employee as fullName(employee) for employee in employees | filter: user.type">
<option value=''>Text you want to display</option>
</select>

要显示的文本

你在哪里找到员工?它是如何居住的?它在原始形式下看起来像什么(即,里面有什么项目)?在那里我编辑了这个问题:我高度怀疑它与角度、AFAIU有任何关系,这只是
的行为。以前已经有人问过:
<select class="form-control" ng-model="user.fullname"
ng-options="employee as fullName(employee) for employee in employees | filter: user.type">
<option value=''>Text you want to display</option>
</select>