Search Posts

Category: browser

Unable to handle a function on browser refresh

When I click refresh, I want to run a function which I am unable to. The refresh should be handled only when there are unsaved changes. var timer; var isNavigation = false; $window.onbeforeunload = function(evt) { isNavigation = true; debugger; if ($rootScope.isReviewFormSubmitEnabled) { debugger; var message = ‘ ‘; timer = $timeout(stayOnPage, 100); evt = evt || window.evt; evt.returnValue = message; return message; //Handling leave click on leave/stay option $window.onunload = function() { debugger; $appTimeOutService.stopTimeOut(); […]

Angularjs how to get browser history list?

I want to remove my history, so I use this code $state.go(toGo, params, {location: ‘replace’}) When I use this, I could remove the very last history. And my question is, how to remove history before the last removed page. For example, to see the content of an item, I move into detailPage Click edit Button to edit this item, and move into editPage. After I finish editing this, press finish Button, and move into detailPage […]