Activity Forums Salesforce® Discussions what is the use of <aura:set> in Salesforce lightning ?

  • Hariom Chaudhary

    Member
    September 3, 2019 at 6:15 am

    Hi,

    We use <aura:set> in markup to set the value of an attribute inherited from a component or event.

  • Deepak

    Member
    September 3, 2019 at 6:18 am

    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 c:setTagSuper component.

    <!--c:setTagSuper-->
    <aura:component extensible="true">
    <aura:attribute name="address1" type="String" />
    setTagSuper address1: {!v.address1}<br/>
    </aura:component>

    c:setTagSuper outputs:

    setTagSuper address1:

    The address1 attribute doesn't output any value yet as it hasn't been set.

    Here is the c:setTagSub component that extends c:setTagSuper.

    <!--c:setTagSub-->
    <aura:component extends="c:setTagSuper">
    <aura:set attribute="address1" value="808 State St" />
    </aura:component>

    c:setTagSub outputs:

    setTagSuper address1: 808 State St

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos