title: Communication between controllers Angularjs, service or parent controller
body: <p>I am wondering which is best practise, or perhaps in which situation one way is preferred over the other.</p>
  
  <p>The setup is as follows if we use a parent(main) controller:</p>
  
  <pre><code>&lt;div ng-controller="Controller Main"&gt;
    &lt;div ng-controller="Controller 1"&gt;&lt;/div&gt;
    &lt;div ng-controller="Controller 2"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>So we can communicate here because both controller 1 and 2 have access to Controller Main's scope.</p>
  
  <p>The other way is if we use a service,</p>
  
  <pre><code>&lt;div ng-controller="Controller 1"&gt;&lt;/div&gt;
  &lt;div ng-controller="Controller 2"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>So what I think we're doing is that we inject the service to the controllers.</p>
  
  <p>I've seen both solutions but I don't know which one is preferred.</p>