I am coming from a WPF background where in Prism you have the IEventAggregator interface. You define events that you can subscribe to from controllers, and then you publish the event from another controller. It is a way to communicate between controllers that do not know about each other.
Is there anything similar in Angular JS?
ie I have a top level controller for an index.html page that contains three sub panels, each with their own controller. I want the top level controller to be able to call refresh() on the panel controllers but it has no reference to those controllers.
I think you can use $scope.$broadcast to send action to children contorllers;
After you send data by
$scope.$broadcast('customEvent', {
command: 'reload'
});
you can set listener in child controller
$scope.$on('customEvent', function (event, data) {
if(data === 'reload'){
//reload
}
});
Good explanation is here: http://toddmotto.com/all-about-angulars-emit-broadcast-on-publish-subscribing/