You can cancel the event.
$scope.$on('$locationChangeStart', function(event, next, current) {
if ($scope.hasChanges() & blockNavigation) {
event.preventDefault();
MessageService.showConfirmation(
'Are you sure?',
MessageService.MessageOptions.YES_NO,
{'YES': function() {
blockNavigation = false;
$location.url($location.url(next).hash());
$rootScope.$apply();
},
'NO': function(){MessageService.clear(); $log.log('NO Selected')}});
}
});
Cheers