Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reload page the page with pagination in Angular 2? [closed]

How can I reload the current page on Angular 2?

if iam in page 2 (pagination) and refresh the page it will show page 1(URL pageload) but i want i refresh the page 2 and it will appear in page 2

like image 366
FABI1987 Avatar asked May 15 '17 17:05

FABI1987


People also ask

How to reload whole page in Angular?

One is to use window. reload to reload the entire page, and the other is to use the onSameUrlNavigation-reload refresh component with an angle router.

How to reload on page from another page in Angular?

Use window. location. reload() to Reload Current Page in Angular.

How do you reload an ionic page?

“reload ionic page” Code Answer's // Go to voice: resets all view cache: so data is reloaded with currently language.


1 Answers

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.

like image 197
Alexander Staroselsky Avatar answered Oct 13 '22 19:10

Alexander Staroselsky