Is angularjs user friendly by clicking the refresh button in a browser? Is there any method that the infrastructure provides to the developer?
thanks
To deal with the reboot itself (including the F5 hit) and take action before rebooting or even canceling, use the "beforeunload" event.
var windowElement = angular.element($window); windowElement.on('beforeunload', function (event) { //Do Something //After this will prevent reload or navigating away. event.preventDefault(); });
You can use $routeChageStart :
$routeChageStart
$rootScope.$on('$routeChangeStart', function () { alert('refresh'); });
Source: https://habr.com/ru/post/969962/More articles:How to run two AsyncTasks in one action? - androidDo I need to βfindβ return nodes in order? - domJQuery assigns an element to a variable - variablesOrder libxml xmlXPathEvalExpression - cOne header for multiple cpp files - c ++Select specific rows (condition satisfied), but only some columns in Python / Numpy - pythonmultiple multiple buffering - pythonOverride $ argv for getopt - phpCrystalDecisions.CrystalReports.Engine DLL - .netASP.NET Web Queries for Multithreading - multithreadingAll Articles