我希望在列表中有过滤后的行数。 使用dir-paginate,结果总是5(== itemsPerPage)或者我有> 5行。 有谁知道如何在我的dir-paginate中获取所有页面的行数?
<div>count filtered : ({{ filtered.length }})</div>
<input type="text" class=" text-input form-control" ng-model="search.name" placeholder="name">
<div class="col-md-6">
<table class="table">
<thead>
<tr>
<th></th>
<th>Title</th>
</tr>
</thead>
<tbody>
<tr dir-paginate="person in persons | filter:_this.search | itemsPerPage:5 as filtered" pagination-id="excluded">
<td>{{ person.name }}</td>
</tr>
</tbody>
</table>
</div>
<dir-pagination-controls max-size="5"
direction-links="true"
boundary-links="true" class="pagination">
</dir-pagination-controls>
&#13;
感谢
答案 0 :(得分:2)
您必须手动执行此行计数
更改
<tr dir-paginate="person in persons | filter:_this.search | itemsPerPage:5 as filtered" pagination-id="excluded">
到
<tr dir-paginate="person in filtered = (persons | filter:_this.search) | itemsPerPage:5 " pagination-id="excluded">
您可以按filtered.length