angularjs需要获得过滤项目的数量

angularjs需要获得过滤项目的数量,angularjs,Angularjs,我有一个项目,在该项目中,im根据预定义的条件(即批准或待定)对数据进行排序。但我也使用了页面选择。我的问题是,我无法通过程序获得正确数量的对象以显示正确数量的页面(总是有额外的页面,因为它需要的是完整数量而不是过滤数量),因此我知道我需要以某种方式获得过滤对象的数量以显示正确数量的页面。有人能解释一下怎么做吗 滤器 <select class="form-control" ng-model="filterType" ng-op

我有一个项目,在该项目中,im根据预定义的条件(即批准或待定)对数据进行排序。但我也使用了页面选择。我的问题是,我无法通过程序获得正确数量的对象以显示正确数量的页面(总是有额外的页面,因为它需要的是完整数量而不是过滤数量),因此我知道我需要以某种方式获得过滤对象的数量以显示正确数量的页面。有人能解释一下怎么做吗

滤器

               <select class="form-control" ng-model="filterType"
                ng-options="pages for pages in filterSelection"
                ng-change="filterAmount()"
                ng-init="filterType=filterSelection[1]">

            </select>

#每页页数:

               <select ng-model="itemperpage"
                class="form-control" ng-options="pages for pages in selection"
                ng-init="itemperpage=selection[0]"></select>
            <pagination total-items="max" page="currpage"
                items-per-page="itemperpage" max-size="maxSize"
                class="pagination-sm" rotate="false" num-pages="numPages"></pagination>
        </div>

实际表格

        <table
            class="table table-hover table-striped table-bordered table-condensed col-md-1">
            <tr>
                <th>Employee Name
                <th>Period</th>
                <th>Status</th>
                <th>Regular Hours</th>
                <th>Overtime Hours</th>
                <th>Total Hours</th>
                <th>Attachment</th>
                <th>Client</th>
                <th>Approve</th>
                <th>Deny</th>
            </tr>
            <tr ng-repeat="employee in (filteredItems = (timeSheets|filter:filterType))" ng-if="$index>=((currpage-1)*itemperpage) && $index<((currpage)*itemperpage)">
                <td>{{employee.name}}</td>
                <td>{{employee.period}}</td>
                <td>{{employee.status}}</td>
                <td>{{employee.regHours}}</td>
                <td>{{employee.overHours}}</td>
                <td>{{employee.totHours}}</td>
                <td><div ng-controller=imageController
                        ng-init="init(employee.username)">
                        <input class="btn btn-primary btn-md btn-block" "type="button"
                            ng-click="imageModal(employee.username,employee.period)"
                            value="View" />
                    </div></td>
                <td>{{employee.Client}}</td>
                <td><input class="btn btn-primary btn-md btn-block"
                    "type="button"
                    ng-click="approveTimesheet(employee.username,employee.period)"
                    ng-disabled="(employee.status=='approved')" value="Approve" /></td>
                <td><input class="btn btn-primary btn-md btn-block"
                    "type="button"
                    ng-click="denyTimesheet(employee.username,employee.period)"
                    value="Deny" /></td>
            </tr>
        </table>
    </div>

员工姓名
时期
地位
正常工作时间
加班时间
总小时数
附件
客户
批准
否认
{{employee.name}
{{employee.period}
{{employee.status}
{{employee.regHours}
{{employee.overHours}}
{{employee.totHours}
<tr ng-repeat="employee in (filteredItems = (timeSheets|filter:filterType))"</tr>
and then in pagination using

<pagination total-items=filteredItems.length page="currpage"
                items-per-page="itemperpage" max-size="maxSize"
                class="pagination-sm" rotate="false" num-pages="numPages"></pagination>
        </div>