title: Passing control to another controller in angularjs
body: <p>I am pretty new to angularjs and still getting used to the concepts.</p>
  
  <p>This is the premise of my problem- I have 2 peer controllers (no parent child relationship), controller1 does say steps 1 to 10, controller 2 does something else until it finds something which is the step 7 of controller 1. So after that controller 2 needs to do the same last steps. Is there a way I can call a function in controller 1 from controller 2 so that there is no code replication. Do I need to create a service for this or is there a way to just call a function in another controller from one in angularjs</p>
  
  <p>I have seen these 2 links and am wondering if there is an easier way to just call a function in another controller from one , may be using $rootscope.</p>
  
  <p><a href="https://stackoverflow.com/questions/18148950/passing-data-from-one-controller-to-other-angular">Passing data from one controller to other Angular</a></p>
  
  <p><a href="https://stackoverflow.com/questions/12008908/how-can-i-pass-variables-between-controllers-in-angularjs">AngularJS: How can I pass variables between controllers?</a></p>