I created two directives, lets say A and B:
<A>
<B />
</A>
A is a transclude. And A's and B's scopes are inherited from their ng-controllers.
I want to connect A and B using events. According to they both use ng-controller scope i have to write something like this: in A's controller
$scope.$parent.$broadcast(..)
and in B's controller:
$scope.$on(...)
It works fine.
But what if i dont want to use ng-controllers? Like im developing independed complex directive which contains sub-directs (like A contains B). Is it possible to say angular to inherit B's scope from A's scope? So i would be able to do it like: in A's:
$scope.$broadcast(..)
and in B's
$scope.$on(..)