title: communicate between 2 different controllers
body: <p>I have an angular app where we have 4 different pages.Each page has its own controller. There is an home page which has a controller which routes to each page and its controller using  </p>
  
  <pre><code>when('/a',{
              templateUrl: './components/a.html',
              controller:'aCtrl'
      }).
  when('/b',{
              templateUrl: './components/b.html',
              controller:'bCtrl'
      }).
  when('/c',{
              templateUrl: './components/c.html',
              controller:'cCtrl'
      }).
  when('/d',{
              templateUrl: './components/d.html',
              controller:'dCtrl'
      }).
  when('/home',{
              templateUrl: './components/Home.html',
              controller:homeCtrl'
  }).
  </code></pre>
  
  <p>Now I want to share some data or some common functions between these controllers/pages. How can we do this? I googled it they say to use SERVICE. But I don't know in which controller I need to write the service. Can anybody give a good example for this.</p>