2

the application is developed using routing concepts of angular2 and when I run npm start and after loading successfully and application open up in a browser, after opening the F5 and refresh button in a browser should be disabled.

James Z
  • 12,209
  • 10
  • 24
  • 44

1 Answers1

2

While there probably are possibilities to prevent a user refreshing or navigating from a page, I would strongly advise against using these kind of patterns.

Instead, try to preserve the users data if necessary (cookies, local storage, backend, ...).

Jens Habegger
  • 5,266
  • 41
  • 57
  • F5 disable is working by adding the script in HTML, but still when is press refresh button on browser the page is loading, it should also be disabled. – nikhil bukkitu May 09 '18 at 10:24