LIGHTNING COMPONENT ATTRIBUTE

Salesforce Lightning Component Attribute

Lightning Component Attribute

We have discussed the salesforce lightning component aura attribute in the previous EPISODE. Now in this episode, we are gonna discuss lightning component attribute.

Previously we have defined <aura:attribute> tag in lightning component .cmp file.
Now, what if you can define these attribute somewhere else? yes !! you can define these attributes directly inside Aura Application as well this is called as a component attribute.

 Let's try this out and by creating simple attribute inside Aura Application.

Component Attribute: HelloWorld.app
=============================================
<aura:application>

  <aura:attribute name="val1" 
                             type="string" 
                             default="Salesforce"/>

  <aura:attribute name="val2" 
                             type="string" 
                             default="Kid"/> 
      Hello {!v.val1} {!v.val2}

</aura:application>
=============================================

Now hit preview button available on the right side in the developer console.

Output: 
=============================================

Hello Salesforce Kid

=============================================

Coool !! Now we have 2 different ways to to to define aura:attribute one is by creating a lightning component and then calling it in the lightning application, Another way is lightning component attribute as discussed in this episode.



WOHOOO !! YOU HAVE JUST CREATED APPLICATION BY USING COMPONENT ATTRIBUTE
If you like this salesforcekid learning platform please let me know in the Comment section...Also, Share with your salesforce folks wish you 
Happy learning ☁️⚡️ (Learn. Help. Share.)

<< PREVIOUS                                                      NEXT >>

LIGHTNING COMPONENT ATTRIBUTE LIGHTNING COMPONENT ATTRIBUTE Reviewed by on Rating: 5

No comments:

HELP !! SHARE !! SUGGEST !!

Powered by Blogger.