I am trying to toast errors those are handled in the $exceptionHandler decorator as follows,
var app = angular.module('myApp',['toaster']);
app.config(function($provide){
$provide.decorator('$exceptionHandler',function($delegate,toaster){
toaster.pop('error','text','error');
$delegate(exception, cause);
});
});
Here is the plunkr. This is giving me the following error,
Error: [$injector:cdep] Circular dependency found: $rootScope <- toaster <- $exceptionHandler <- $rootScope
I am using AngularJS-Toaster for showing errors. How can I inject toaster service inside the decorator now?