The Trailblazer Community in Slack is now in Open Beta—join and connect in real time. [Join us in Slack]
A component can handle its own event by using the <aura:handler> tag in its markup.
The action attribute of <aura:handler> sets the client-side controller action to handle the event. For example:
1<aura:registerEvent name="sampleComponentEvent" type="c:compEvent"/>
2<aura:handler name="sampleComponentEvent" event="c:compEvent"
3 action="{!c.handleSampleEvent}"/>The name attributes in <aura:registerEvent> and <aura:handler> must match, since each event is defined by its name.
Note
See Also