In this for each example , I am trying to create a handler after successful creation of event and registering that event, But while referencing aura:handler
tag,
I am getting this error :
Failed to save undefined: aura:handler must specify one and only one of name="…" or event="…": Source
I need solution for bubbling event example.
Here is the link which is giving some kind of solution bt I am not able to understand it.
<!--docsample:eventBubblingGrandchild-->
<aura:component>
<aura:handler name="bubblingEvent" event="docsample:compEvent" action="{!c.handleBubbling}"/>
<div class="grandchild">
<docsample:eventBubblingEmitter />
</div>
<aura:component>
working one
<aura:component>
<div class="grandchild">
<docsample:eventBubblingEmitter bubblingEvent="{!c.handleBubbling}"/>
</div>
<aura:component>
but eventBubblingChild
component has the following code. and there , we are not copying any component tag.
What will be solution for below code ?
<!--docsample:eventBubblingChild-->
<aura:component>
<aura:handler name="bubblingEvent" event="docsample:compEvent" action="{!c.handleBubbling}"/>
<div class="child">
{!v.body}
</div>
</aura:component>
Event is component type