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>
How to refresh component from same component in Angular? Use the this. ngOnInit(); to reload the same component instead reloading the entire page!!
Try this: window.location.reload();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With