What\'s the correct way to communicate between controllers?
I\'m currently using a horrible fudge involving window
:
function StockSubgro
Actually using emit and broadcast is inefficient because the event bubbles up and down the scope hierarchy which can easily degrade into performance bottlement for a complex application.
I would suggest to use a service. Here is how I recently implemented it in one of my projects - https://gist.github.com/3384419.
Basic idea - register a pubsub/event bus as a service. Then inject that eventbus where ever you need to subscribe or publish events/topics.