Skip to content

Instantly share code, notes, and snippets.

Created March 23, 2017 13:41
  • Star 2 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Lightning - Passing data down the component hierarchy via attributes and a change handler
<aura:attribute name="childAttribute" type="String"/>
<aura:handler name="change" value="{!v.childAttribute}" action="{!c.onChildAttributeChange}"/>
onChildAttributeChange : function (component, event, helper) {
console.log("Old value: " + event.getParam("oldValue"));
console.log("Current value: " + event.getParam("value"));
<aura:attribute name="parentAttribute" type="String"/>
<c:childCopmponent childAttribute="{!v.parentAttribute}"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment