I have a strange problem with calling the e.preventDefault inside handler for a $locationChangeStart event. I have something like this:
var unregisterCallback = _this.$rootScope.$on('$locationChangeStart', function (e) {
e.preventDefault();
});
This is happens in a link function for one of the directivies. The problem is that when I click an anchor element with some path, it actually navigates to it and then back. I'm using component router from Angular 1.5. This pretty much makes this usless, as I'm trying to show a confirmation dialog before user nagivates away without saving changes. The thing is, due to this re-navigation he looses all changes anyways. Any idea what's going on?