Newer Version Available
Setting Attributes Inherited from a Super Component
Use <aura:set> in the markup of a sub component to set the value of an inherited attribute.
Let's look at an example. Here is the docsample:setTagSuper component.
docsample:setTagSuper outputs:
The address1 attribute doesn't output any value yet as it hasn't been set.
Here is the docsample:setTagSub component that extends docsample:setTagSuper.
docsample:setTagSub outputs:
sampleSetTagExdocsample:setTagSub sets a value for the address1 attribute inherited from the super component, docsample:setTagSuper.
If you’re using a component by making a reference to it in your component, you can set the attribute value directly in the markup. For example, docsample:setTagSuperRef makes a reference to docsample:setTagSuper and sets the address1 attribute directly without using aura:set.
docsample:setTagSuperRef outputs: