Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular refreshing page with a button

What I want to do is have a button that does the same thing as the refresh button in chrome does. I have tried location.reload(), and it doesn't seem to really do anything. Is there any way to do this?

exit() {
    location.reload();
  }

 <button [routerLink]="['/dashboard']" (click)="exit()">Exit</button>
like image 206
John Avatar asked Jun 08 '17 17:06

John


People also ask

How can I refresh a page in angular?

How to refresh component from same component in Angular? Use the this. ngOnInit(); to reload the same component instead reloading the entire page!!


1 Answers

Try this: window.location.reload();

like image 99
CodeWarrior Avatar answered Sep 30 '22 18:09

CodeWarrior