Salesforce Certified Application Architect

Thursday 8 February 2018

How to register, fire and handle a component and application event?

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}”/>





No comments:

Post a Comment

Salesforce Certified Application Architect & Certified Data Architecture and Management Designer Exam

How to pass Salesforce Certified Data Architecture and Management Designer Exam This exam was 1st architect exam for me. Its not that muc...