title: Syntax: how to listen or an $emit in a Service?
body: <p>I want to listen for 'myEmittedEvent' on rootScope, but have a problem with this code:</p>
  <pre><code>app.service('MyService',function($rootScope){     
        $rootScope.$on('myEmittedEvent', function(){    &lt;===== error here
             // code goes here
        });
  });
  </code></pre>
  <p>The Browser console shows <code>Uncaught SyntaxError: Unexpected token .</code>  and the Brackets IDE says <code>Expected ':' and instead saw '.' - W116</code></p>
  <p>What am I doing wrong?</p>
  <h2>Update</h2>
  <p>The <code>$rootScope.$on</code> code is fine in a controller. Even in my service - but only before the <code>return</code> part. I expect that it should be in the object which the service instantiates.</p>
  <p>I am an Angular beginner, how do I <code>$on</code> or <code>$watch</code> in a service?</p>