title: angular JS - communicate between non-dependend services
body: <p>I am new in angular and encounter a catch-22:</p>
  
  <p><strong>Facts:</strong></p>
  
  <ol>
  <li><p>I have a service that logs my stuff (my-logger).</p></li>
  <li><p>I have replaced the $ExceptionHandler (of angular), with my own implementation which forwards uncaught exceptions to my-logger service</p></li>
  <li><p>I have another service, pusher-service, that needs to be notified whenever a fatal message is to be logged somewhere in my application using 'my-logger'.</p></li>
  </ol>
  
  <p><strong>Problem:</strong></p>
  
  <p>I can't have 'my-logger' be depend on 'pusher' since it will create circular dependency (as 'pusher' uses $http. The circle: $ExceptionHandler -> my-logger -> pusher -> $http -> $ExceptionHandler...)</p>
  
  <p><strong>My attempts:</strong></p>
  
  <p>In order to make these 2 services communicate with each other, I wanted to use $watch on the pusher-service: watches a property on $rootscope that will be updated in my-logger.
  But, when trying to consume $rootScope in 'my-logger', in order to update the property on which the 'pusher' "watches", I fail on circular dependency as it turns out that $rootscope depends on $ExceptionHandler (the circle: $ExceptionHandler -> my-logger -> $rootScope -> $ExceptionHandler).</p>
  
  <p>Tried to find an option to get, at runtime, the scope object that in its context 'my-logger' service works. can't find such an option.</p>
  
  <p>Can't use broadcast as well, as it requires my-logger to get access to the scope ($rootScope) and that is impossible as seen above.</p>
  
  <p><strong>My Question:</strong></p>
  
  <p>Is there an angular way to have two services communicate through a 3rd party entity ?</p>
  
  <p>Any idea how this can be solved ? </p>