当我们以angular2

时间:2018-02-10 16:05:31

标签: angular typescript

https://ciphertrick.com/2016/10/19/simple-pagination-for-angular2-applications/

请参阅上面的服务器端分页控制链接。

import {Component} from '@angular/core';

@Component({
    selector: 'app-home',
    template: `<h1>{{welcome}}</h1>
                <table class="table">
                    <tr>
                        <th>#</th>
                        <th>Game</th>
                        <th>Platform</th> 
                        <th>Release</th>
                    </tr>
                    <tr *ngFor="let game of games | paginate: {itemsPerPage: 5, currentPage:page, id: '1'}; let i = index">
                        <td>{{i + 1}}</td>
                        <td>{{game.game}}</td>
                        <td>{{game.platform}}</td>
                        <td>{{game.release}}</td>
                    </tr>
                </table>
                <pagination-controls (pageChange)="page = $event" id="1"
                      maxSize="5"
                      directionLinks="true"
                      autoHide="true">
                </pagination-controls>`
})
export class HomeComponent {
...
..
...
}

如果我有新的刷新数据,那么即使我将当前页面设为1,寻呼机链接也无法正常工作。仍然显示以前的链接启用。

我身边有遗漏吗?如何在angular2?

中获取刷新数据后刷新下一个和上一个链接的寻呼机

0 个答案:

没有答案