Angular.js – how block back operation in browser

 

If You are going in AngularJS block back operation in browser and call your own functions use below code in directive, controller


$scope.$on('$locationChangeStart', function(event, next, current){
// Here you can take the control and call your own functions:
alert('Sorry! Back Button and operations is disabled');
// Prevent the browser default action (Going back):
 event.preventDefault();

});
March 7th, 2017

  • My husband and i have been really contented Michael managed to round up his basic research using the ideas he grabbed while using the blog. It is now and again perplexing to just be freely giving guidelines which many people might have been making money from. Therefore we realize we have got the blog owner to appreciate because of that. Those explanations you made, the easy site navigation, the friendships you assist to instill – it’s many sensational, and it is helping our son and us know that the article is interesting, which is quite serious. Thanks for the whole thing!.

  • Thanks a lot for providing individuals with a very pleasant possiblity to read from this web site. It’s always very brilliant and as well , jam-packed with a great time for me and my office mates to visit your website at minimum 3 times in 7 days to read through the newest guidance you have. Of course, I am also usually satisfied with your mind-blowing knowledge you serve. Selected 1 ideas in this posting are in truth the most impressive I have ever had..