I am pretty new to angularjs and still getting used to the concepts.
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
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.