Communicating Between Gadgets Using Events
Communication between gadgets is necessary to allow information to be shared between one or more gadgets. Gadget communication is possible only between AngularJS gadgets.
There are two ways to allow communication between gadgets:
JavaScript based EventBus
AngularJS events
AngularJS defined events are sometimes not favorable for communication between gadgets as we need to decide the event flow (upwards or downwards) based on the logic. A more appropriate way for communication is to provide publish-subscribe mechanism for communication.
Gadget framework provides another communication mechanism using a JavaScript based EventBus that registers all the events from the controller when the controller is getting loaded.