<分区>
我在一个站点中使用 angularjs,我有一个搜索输入可以过滤 View 中的列表。此列表与 ng-repeat 一起显示,该 ng-repeat 具有来自搜索输入的过滤器:
搜索输入:
<input type="text" placeholder="Device Search" class="form-control hasclear"
ng-model="searchText"/>
这里是 ng-repeat:
<tr ng-click="openModal(device['device_id'], device)"
ng-repeat="device in devices | filter:searchText | orderBy:predicate:reverse">
如您所见,ng-repeat 中的过滤器具有使用 ng-model 中的 searchText 变量的过滤器。我想知道是否有可能知道当用户在搜索输入中输入文本时找到了多少个对象(ng-repeat 显示有多少设备被过滤)。比如:0 台设备被发现
,3 台设备被发现
...
有没有办法通过我构建此搜索的方式来显示此信息?