Angular6 NGX分页消息用于记录未正确显示



我在列表上使用了NGX分页包含330个记录,我给了页面的项目为10。但是,当加载页面时,它显示出>"在330中显示330"之类的消息。而不是" 330"中的10个。所以任何人都可以建议我解决方案吗?

这是我的代码:

<div class="message">
  Showing : <b>{{tempAccountType?.length}}</b> Out of : <b>{{AccountType?.length}}</b> Records.
</div>
<div>
  <pagination-controls (pageChange)="pageActual = $event" responsive="true" previousLabel="Previous" nextLabel="Next">
  </pagination-controls>
</div>

PaginatePipe应放置在NGFOR表达的末端。 它接受一个参数,一个符合的对象 paginationinstance接口。

<div class="list">
        <ul>
            <li *ngFor="let item of collection | paginate:  {
                currentPage: 1,
                itemsPerPage: 10}">
                {{ item }}
            </li>
        </ul>
  <pagination-controls  
    (pageChange)="pageActual = $event" 
    responsive="true" 
    previousLabel="Previous" 
    nextLabel="Next">
  </pagination-controls>
</div>

示例:https://stackblitz.com/edit/ngx-pagination

有关更多信息,请查看文档:https://www.npmjs.com/package/ngx-pagination#paginatepipe

最新更新