Saturday, 7 September 2013

angularjs cancel event listener

angularjs cancel event listener

I have a login page which redirects to a landing page upon successful
login. To avoid the user from pressing the Back button on the landing
page, I added the following:
$scope.$on('$locationChangeStart', function(event, newUrl, oldUrl) {
event.preventDefault(); });
There are, however situations (eg: the server restarts), when I need to
redirect the user to the login page. How do I go about cancelling the
above binding?

No comments:

Post a Comment