How to set default values to variable in Salesforce lightning component?

Sample Code:

Component:

<aura:component >
    <aura:attribute name="newItem" type="Camping_Item__c"
    default="{ 'sobjectType': 'Camping_Item__c',
                    'Price__c': 0,
                    'Quantity__c': 0}"/>
</aura:component>

Cheers!!!

No comments:

Post a Comment