I need to perform certain actions in Angular when the page is reloaded, such as adding items to local storage before the page loads and removing items after the page has fully loaded.
In other words, I want to execute some tasks both before and after refreshing the page in Angular.
What is the best way to address this issue?