angular pagination 跳转指定页面

这是我的代码:

<tr *ngFor="let items of topics.data | paginate: { itemsPerPage: 5, currentPage: p }">
</tr>

 <div class="d-flex">
          <pagination-controls
            (pageChange)="p = $event"
            previousLabel=""
            nextLabel=""
            directionLinks="true"
            maxSize="6"
            autoHide="false"
            responsive="true"
            class="myPagination">
          </pagination-controls>
          <span class="small">跳转到</span>
          <input style="width: 2rem; height: 1.2rem">
          <button nz-button nzType="primary" [nzSize]="'small'">跳转</button>
        </div>请输入代码

基本功能已经实现
现在我想要实现 用户输入指定页面的数字,点击“跳转”,就可以跳转到指定页面,接下来就不会了。希望那位大神看到了 可以指导一下。非常感谢

阅读 3k
1 个回答

跳转指定页面不就是更新当前 currentPage 的值嘛,跟你点击下一页,上一页一样的道理,也是更新 currentPage 的值