Newer Version Available

This content describes an older version of this product. View Latest

Setting Attributes Inherited from an Interface

To set the value of an attribute inherited from an interface, redefine the attribute in the component. For example, a component implements an interface that has an attribute myBoolean set to false. The following example sets myBoolean on the component to true.

1swfobject.registerObject("clippy.codeblock-0", "9");<aura:component implements="auradocs:myIntf">
2    <aura:attribute name="myBoolean" type="Boolean" default="true" />
3</aura:component>

If the component that implements the interface is contained in another component, you can use aura:set as discussed. Alternatively, you can set the attribute value like this.

1swfobject.registerObject("clippy.codeblock-1", "9");<aura:component>
2    <auradocs:sampleCmp myBoolean="true" />
3</aura:component>