Now my task is to rewrite $exceptionHandler provider so that it will output modal dialog with message and stop default event.
What I do:
in project init I use method .provider:
.provider('$exceptionHandler', function(){
//and here I would like to have rootScope to make event broadcast
})
standart inject method does not work.
UPD: sandbox - http://jsfiddle.net/STEVER/PYpdM/
My way of doing this - using a decorator and reverting to the previous exception handler on unknown errors:
You need to inject the $rootScope:
Is this what you tried? And if so do you have an error message or a jsfillde/plnkr to see why it failed?
You can inject the injector and lookup the $rootScope.
Demo plunkr: http://plnkr.co/edit/0hpTkXx5WkvKN3Wn5EmY?p=preview
Update: add .provider technique too: