Basic problem is, I have a modal window which I want to activate when certain terms are not satisfied. Modal should be active ( disabling user to do anything else but clicking on a modal button) on every state/URL change. I managed to have that working when manually typing correct 'state addresses', e.g. there is state.('dogs') and when I type 'dogs', modal stands open and nothing else is happening. Yet, if I mistype e.g. 'dogzz' modal closes.
The root of the problem is that I control modal with
$rootScope.$on('$stateChangeStart', function(event...
It turns that UI-Router won't detect anything that isn't registered as a state? I tried
$rootScope.$on('$stateChangeError', function (event) {...
and it won't catch 'irregular' i.e. mistyped URL. I console logged
'$stateNotFound', '$stateChangeError', '$stateChangeStart'
and nothing catches mistyped URLs. Searching for some universal, non ui-router solution didn't help, which is kinda strange because 'route prevent' problem seems to be universal.
So, I need to catch mistyped route changes, in essence.