Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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>
({
onChildAttributeChange : function (component, event, helper) {
console.log("Old value: " + event.getParam("oldValue"));
console.log("Current value: " + event.getParam("value"));
}
})
<aura:component>
<aura:attribute name="parentAttribute" type="String"/>
<c:childCopmponent childAttribute="{!v.parentAttribute}"/>
<aura:component>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.