Unbound Attribute Example:
Child Component
<aura:component>
<aura:attribute name=”childAttr” type=”String” />
<p>childAttr: {!v.childAttr}</p>
</aura:component>
Parent Component
<aura:component>
<aura:attribute name=”parentAttr” type=”String” default=”parent attribute”/>
<!– Instantiate the child component –>
<c:childComponent childAttr=”{#v.parentAttr}” />
<br/><br/>
<p>parentAttr: {!v.parentAttr}</p>
<br/><br/>
<p><lightning:button label=”Update parentAttr” onclick=”{!c.updateParentAttr}”/></p>
</aura:component>
({
updateParentAttr: function(cmp) {
cmp.set(“v.parentAttr”, “updated parent attribute”);
}
})
App
<aura:application >
<c:parentComponent />
</aura:application>
Output:
Before clicking Update parentAtt:
After clicking Update parentAtt:
Bound Attribute Example:
Child Component
<aura:component>
<aura:attribute name=”childAttr” type=”String” />
<p>childAttr: {!v.childAttr}</p>
</aura:component>
Parent Component
<aura:component>
<aura:attribute name=”parentAttr” type=”String” default=”parent attribute”/>
<!– Instantiate the child component –>
<c:childComponent childAttr=”{!v.parentAttr}” />
<br/><br/>
<p>parentAttr: {!v.parentAttr}</p>
<br/><br/>
<p><lightning:button label=”Update parentAttr” onclick=”{!c.updateParentAttr}”/></p>
</aura:component>
({
updateParentAttr: function(cmp) {
cmp.set(“v.parentAttr”, “updated parent attribute”);
}
})
App
<aura:application >
<c:parentComponent />
</aura:application>
Output:
Before clicking Update parentAtt:
Check the below link for more information
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/expr_data_binding.htm