When a user clicks or presses the F5
button on an HTML page, the page refreshes. However, before the refresh occurs, I want to execute a function or display a simple alert.
The user can trigger a refresh by clicking the refresh button, pressing F5
, or using Ctrl + R.
This action should be achieved using Angular 2/4.