[SOLVED] Angular refreshing page with a button

Issue

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>

Solution

Try this: window.location.reload();

Answered By – CodeWarrior

Answer Checked By – David Goodson (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *