You'll need to couple the event listener to $rootScope in Angular 1.x, but you should probably future proof your code a bit by not storing the value of the previous location on $rootScope. A better place to store the value would be a service:
var app = angular.module('myApp', [])
.service('locationHistoryService', function(){
return {
previousLocation: null,
store: function(location){
this.previousLocation = location;
},
get: function(){
return this.previousLocation;
}
})
.run(['$rootScope', 'locationHistoryService', function($location, locationHistoryService){
$rootScope.$on('$locationChangeSuccess', function(e, newLocation, oldLocation){
locationHistoryService.store(oldLocation);
});
}]);