Handling component events

To handle a component event, declare an aura:handler in the handling component. Note that you will need to specify the exact name of the handler, equal to the name used when registering the event:

<aura:handler name="sampleComponentEvent" event="c:compEvent"
action="{!c.handleComponentEvent}"/>

Note that a component can also self-handle an event raised by itself. In that case, both the register and handler tags are present on the component. The syntax is as follows:

<aura:registerEvent name="sampleComponentEvent" type="c:compEvent"/>
<aura:handler name="sampleComponentEvent" event="c:compEvent"
action="{!c.handleSampleEvent}"/>
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.148.113.229