title: Why a service of main module available in other modules?
body: <p>I have a main module <code>main</code> which contains a service <code>mainService</code>. I have then injected another module <code>moduleA</code> in my main module. I randomly called <code>mainService</code> in <code>moduleA</code> without injecting <code>main</code> module and was amazed to see it is working fine.</p>
  
  <pre><code>angular.module('main', ['moduleA']);
  angular.module('main').service('mainService', function(){
     //insert code here
  });
  
  angular.module('moduleA', []);
  angular.module('moduleA').controller('abc', function(mainService){
     //mainService available here, without injecting main module
  });
  </code></pre>
  
  <p>I want to know the reason behind this. I once read in a comment that a service defined in a module is available everywhere in the application, but couldn't find the source. Is it ok to continue using it like this?</p>
  
  <p>I'm using <code>AngularJS ver 1.3.15</code> if it helps.</p>