0

我使用2角爲我的項目之一,我使用NGX-分頁爲我的拼版頁面的桌子。結構是這樣的多個NGX分頁錯誤角2

parent->child1=table1 
     child2-table-2 
     child-table-3 
     child4-table-4 

每個孩子調用它自己的休息請求,並填充table.I已經使用的子組件在父如下

<div class="thirteen wide column" name="leave" id="leaveApproval"> 
 
    <div class="ui extended segment"> 
 
     <app-leave-approval></app-leave-approval> 
 
     <div #leaveApproval></div> 
 
    </div> 
 
</div> 
 
<div class="thirteen wide right floated column" #timesheetApproval name="timesheet" id="timesheetApproval"> 
 
    <div class="ui extended segment"> 
 
     <app-timesheetapproval></app-timesheetapproval> 
 
    </div> 
 
</div> 
 

 
<div class="thirteen wide right floated column" #resourceApproval name="resource" id="resourceApproval"> 
 
    <div class="ui extended segment"> 
 
     <app-resource-approval></app-resource-approval> 
 

 
    </div> 
 
    <div></div> 
 
</div>

和在每個子組件我已經使用NGX-分頁作爲

<tr *ngFor="let data of exitProcessPendingList | paginate: { itemsPerPage: 7, currentPage: pgNumber};let i=index"> 

<pagination-controls (pageChange)="pgNumber = $event"></pagination-controls> 

和每個子具有用於PAGENUMBER唯一變量;

現在問題我面臨的是,當我試圖改變一個表的頁面數量,它影響其他子表作爲well.If我點擊第一個表的頁面2,所有其他表改變自己當前頁面到頁面2.我做錯了什麼?我在做什麼有什麼錯誤?

回答

0

在模板中指定的ID解決了我的問題

<pagination-controls id="some_id" (pageChange)="pageChanged($event)" ></pagination-controls> 

| paginate: { id: 'foo'},