dir-paginate和自定义过滤器行数

时间:2016-03-30 15:44:30

标签: angularjs pagination

所以我正在使用正常工作的dir-paginate。但是我希望显示总体情况。 在使用dir-paginate之前,我有这样的代码:

<div class="col-md-6">

    <h3>Excluded ({{ excluded.length }})</h3>

    <div class="table-responsive">
        <table class="table table-hover">
            <thead>
                <tr>
                    <th></th>
                    <th>Title</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="product in controller.products | exclude: controller.model.filters as excluded">
                    <td><img class="img-responsive" ng-src="{{ product.preview.lowRes }}" /></td>
                    <td>{{ product.details.title }}</td>
                </tr>
            </tbody>
        </table>
    </div>

</div>

这很好。但是在使用这样的分页时:

<div class="col-md-6">

    <h3>Excluded ({{ excluded.length }})</h3>

    <div class="table-responsive">
        <table class="table table-hover">
            <thead>
                <tr>
                    <th></th>
                    <th>Title</th>
                </tr>
            </thead>
            <tbody>
                <tr dir-paginate="product in controller.products | itemsPerPage: 10 | exclude: controller.model.filters as excluded" pagination-id="excluded">
                    <td><img class="img-responsive" ng-src="{{ product.preview.lowRes }}" /></td>
                    <td>{{ product.details.title }}</td>
                </tr>
            </tbody>
        </table>
    </div>

</div>

问题是它显示 10 而不是实际总数。有谁知道如何获得总行数而不是当前页面上的行?

0 个答案:

没有答案