Skip to content

Instantly share code, notes, and snippets.

@pozil
pozil / childComponentWithAttribute.cmp
Created March 23, 2017 13:41
Lightning - Passing data down the component hierarchy via attributes and a change handler
<aura:component>
<aura:attribute name="childAttribute" type="String"/>
<aura:handler name="change" value="{!v.childAttribute}" action="{!c.onChildAttributeChange}"/>
<aura:component>
@pozil
pozil / childComponentWithMethod.cmp
Last active March 13, 2021 20:21
Lightning - Passing data down the component hierarchy via a method
<aura:component >
<aura:method name="myMethod" action="{!c.executeMyMethod}">
<aura:attribute name="param1" type="String"/>
<aura:attribute name="param2" type="String"/>
</aura:method>
</aura:component>
@pozil
pozil / componentEvent.evt
Last active June 27, 2021 06:52
Lightning - Passing data up the component hierarchy via a component event
<aura:event type="COMPONENT">
<aura:attribute name="param" type="String"/>
</aura:event>
@pozil
pozil / applicationEvent.evt
Last active March 5, 2022 15:01
Ligthning - Passing data up and around the component hierarchy via an application component
<aura:event type="APPLICATION">
<aura:attribute name="param" type="String"/>
</aura:event>