Am new to AngularJs, I want to write a custom function when user clicks browser back button.
This is my function in my controller. It should invoke when user clicks browser back button.
$scope.backBrnClick = function(){
var userId=1;
$rootScope['backup']['sesionId']=null;
};
How can I achieve this function in Angular JS.