So I have two directives splitter and pane that may be used like so:
<splitter>
<pane></pane>
<pane></pane>
</splitter>
<splitter>
</splitter>
I want them all to have isolate or inherited scope. However I also want to be able to $broadcast (or equivalent) between them so that if I were to $broadcast on one directive's scope, the same event would be triggered on all the nested directives that are listening but not it's parent or siblings (no $rootScope here).
How would one go about doing this? My solution must be future friendly as I will be adding more directives in to the mix which also listen for this event.
$rootScopeto broadcast/receive, which he doesn't want to use. In other words, if you have multiple splitters, the service won't know which child to route it to. Just like using$rootScopeto broadcast, you can't control which listeners get the message.resizeevent I want it to propagate to all children so that they in turn can react to it.window.onresizeis not enough as the elements can be resized individually of the window and should only affect their children that choose to listen.$rootScope. You could use either mechanism to communicate, but you can't properly target. The only way I know of to do that is to have them all have a shared "communications Id", and then filter the messages based on communication IDs. It is ugly, but I can't come up with another solution... other than requiring directive controllers OR not using isolated scope, which you also don't want, I'm sure.