если я даю paginate pipe в Angular Я не получаю данные о загрузке страницы.
<table class="table white-space" id="itemsList">
<thead>
<tr class="table-header-design">
<!-- l-35 -->
<th class=" l-35 l-35-large"> name</th>
<th> date</th>
<th>price</th>
<th>match</th>
</tr>
</thead>
<tbody class="colorblack_obreport" *ngIf="ItemDetails.length>0" >
<tr
*ngFor="let item of ItemDetails | paginate: { itemsPerPage: 5, currentPage: p1 };let i=index;">
<td><span
class="pl-10">{{item.Name}}</span></td>
<td>{{item.Date}}</td>
<td>
<span class="pl-15 font-size14 font-Bold color-black"><span
*ngIf="item.price">{{item.price}}</span></span>
</td>
<td>
<div class="rating-outer">
<star-rating [rating]="item.match" disabled="true"></star-rating>
</div>
</td>
</tr>
</tbody>
<tbody *ngIf="ItemDetails.length===0">
<tr align="center">
<td colspan="6">{{emptyText}}</td>
</tr>
</tbody>
</table>
Пагинация HTML:
<div class="pt-15 pb-15 d-flex justify-content-end pointer">
<pagination-template #pT1="paginationApi" (pageChange)="p1 = $event">
<div class="page_disply ">
<span class="pages pt-10">Page {{ p1 }} of {{ itemListSize }} </span>
<div class="pagination_previous" [ngClass]="{'prv_btn_opacity': !pT1.isFirstPage()}" tabindex="0"
role="button" aria-label="previous">
<button class="mdi mdi-chevron-left btndef-none paginate-btn" *ngIf="!pT1.isFirstPage()"
(click)="pT1.previous();"></button>
<button class="mdi mdi-chevron-left btndef-none paginate-btn"
*ngIf="pT1.isFirstPage()"></button>
</div>
<div class="pagination_next" tabindex="0" role="button" aria-label="next"
[ngClass]="{'nxt_btn_opacity': pT1.isLastPage()}">
<button class="mdi mdi-chevron-right btndef-none paginate-btn" *ngIf="!pT1.isLastPage()"
(click)="pT1.next();"></button>
<button class="mdi mdi-chevron-right btndef-none paginate-btn"
*ngIf="pT1.isLastPage()"></button>
</div>
</div>
</pagination-template>
</div>
Я получаю itemDetails в onInit
, но когда я даю paginate (| paginate: { itemsPerPage: 5, currentPage: p1 })
в HTML, данные не загружаются. Если я удаляю данные, страница загружается.