Scope inheritance issue with isolating scopes (regarding $parent, not the prototypal inheritance) #12059
Description
Hi there,
I'm not exactly sure whether this is intended behaviour or not. At least for me it looks odd.
The thing is, that an isolated scope of a directive that has only an isolated scope (and no template/templateUrl and no transclusion defined) is not considered as a $parent for child scopes inside that element. This makes it impossible to $broadcast down events (or $emit them up to this particular isolated scope), as the child scopes will not be able to register their listeners with that isolated scope (as it cannot be reached through the $parent lookup chain).
Here is a CodePen that illustrates this issue. It first starts with a working example and has further instructions inside how to quickly change it into the described scenario. It uses two simple directives, one of them does only ask for an isolated scope, and the other additionally uses a templateUrl and a transclude: true option. They both use exactly the same linking function which makes it easy to verify that they really only differ in their ddo.
http://codepen.io/NicBright/full/RPVvao/
What do you think? Is this a bug or intended behaviour? If it's the latter, why make a difference here? I do understand that the scope is semantically "isolated", which one could justify in one's head to refer to being isolated from events as well. What bothers me particularly here is, that the behaviour is inconsistent depending on other properties on the ddo.
Regards,
Nicolas