我有一个表,我想用一个选择框过滤。如果我尝试用 过滤它<input>
,效果很好。但是当我用 a 来做时<select>
,桌子就空了。我已经注释掉了<input>
,它有效。任何想法为什么我不能用选择过滤?
<fieldset ng-controller="DimensionListCtrl">
Pipe: <select ng-model="query2.code"
ng-options="pipe.code for pipe in pipes"></select>
<!-- Search: <input ng-model="query2.code"> -->
<table class="table table-striped">
<thead>
<tr>
<th>Code</th>
<th>Pipe title</th>
<th>Size</th>
<th>Inner diameter</th>
<th>Outer diameter</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="dimension in dimensions |filter:query2">
<td>{{dimension.code}}</td>
<td>{{dimension.title_en}}</td>
<td>{{dimension.nominalsize}}</td>
<td>{{dimension.innerdiameter}}</td>
<td>{{dimension.outerdiameter}}</td>
</tr>
</tbody>
</table>
</fieldset>