Categories
Angular Answers

How to reload current page with Angular?

Spread the love

Sometimes, we want to reload current page with Angular.

In this article, we’ll look at how to reload current page with Angular.

How to reload current page with Angular?

To reload current page with Angular, we call navigateByUrl and navigate.

For instance, we write

await this.router.navigateByUrl("", { skipLocationChange: true });
this.router.navigate(["/launchpad"]);

to call navigateByUrl and navigate to reload the /launchpad page.

this.router is a Router instance.

Conclusion

To reload current page with Angular, we call navigateByUrl and navigate.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

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