如何重新加载页面与分页在角度2?

如何重新加载角度2的当前页面?

如果我在第2页(分页)和刷新页面,它将显示第1页(网址页面负载) 但是我想刷新第2页,它会出现在第2页

397674 次浏览

This should technically be achievable using window.location.reload():

HTML:

<button (click)="refresh()">Refresh</button>

TS:

refresh(): void {
window.location.reload();
}

Update:

Here is a basic StackBlitz example showing the refresh in action. Notice the URL on "/hello" path is retained when window.location.reload() is executed.