We register an event by by using the following code:
<aura:registerEvent name=”sampleComponentEvent” type=”c:compEvent”/>
We fire event as shown below:
var compEvent = cmp.getEvent(“sampleComponentEvent”);
compEvent.fire();
Handle component event as below :
<aura:handler name=”sampleComponentEvent” event=”ns:eventName”
action=”{!c.handleComponentEvent}” phase=”capture” />
Handle Application event as below:
<aura:handler event=”c:appEvent” action=”{!c.handleApplicationEvent}”/>
<aura:registerEvent name=”sampleComponentEvent” type=”c:compEvent”/>
We fire event as shown below:
var compEvent = cmp.getEvent(“sampleComponentEvent”);
compEvent.fire();
Handle component event as below :
<aura:handler name=”sampleComponentEvent” event=”ns:eventName”
action=”{!c.handleComponentEvent}” phase=”capture” />
Handle Application event as below:
<aura:handler event=”c:appEvent” action=”{!c.handleApplicationEvent}”/>
No comments:
Post a Comment