I am fighting a fight I cannot understand properly so I come here to get 
some knowledge.

I am porting a jQuery directive to angular. It is to popup alerts. I 
decided to go to the ui-bootstrap $modal route, AKA a directive and a 
factory that will create new directives to append them to the body. So far 
so good, it works perfect for me.

Even when it is really WIP I decided to swap the jQuery version for my 
version and I got a:

Uncaught Error: [$injector:cdep] Circular dependency found: $interpolate <- 
$compile <- toastr <- $exceptionHandler <- $rootScope <- $route

For what I understand, $exceptionHandler is really picky about what you 
inject and normally it suggest you to manual inject with $injector.

My provider is something like:

$get: ['$compile', '$document', '$rootScope', function($compile, $document, 
$rootScope) {


Both $compile and $rootScope are the problematic here.


My question are:


Why is $exceptionHandler so picky? I tried to reproduce my problem creating a 
controller using $rootScope and injecting also my provider and it works good. 
It only seems to fail with $exceptionHandler.


Should I change my $get? Since it compiles new alerts, I need $compile and also 
$rootScope (to give them a scope)


I tried manually getting my library on the exceptionHandler and nothing, it 
still fail and since it is a alert messages, it is normally used as logger and 
logging and $exceptionHandler are friends.


Ideas? Thoughts?

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to