You need to sign in to do that
Don't have an account?
Nitika Semwal 11
Trailhead: Lightning Components Basics- Attributes and Expressions
This code worked-
<aura:component >
<aura:attribute name="item" type="Camping_Item__c" required="True" />
<p>Name:
<ui:outputText value="{!v.item.Name}"/></p>
<p> Price:
<lightning:formattedNumber value="{!v.item.Price__c}" style="currency"/> </p>
<p>Quantity:
<lightning:formattedNumber value="{!v.item.Quantity__c}" style="number"/></p>
<p>
<lightning:input type="toggle" label="Packed?" checked="{!v.item.Packed__c}"/> </p>
</aura:component>
<aura:component >
<aura:attribute name="item" type="Camping_Item__c" required="True" />
<p>Name:
<ui:outputText value="{!v.item.Name}"/></p>
<p> Price:
<lightning:formattedNumber value="{!v.item.Price__c}" style="currency"/> </p>
<p>Quantity:
<lightning:formattedNumber value="{!v.item.Quantity__c}" style="number"/></p>
<p>
<lightning:input type="toggle" label="Packed?" checked="{!v.item.Packed__c}"/> </p>
</aura:component>
use this code to complete the challenge:
<aura:component >
<aura:attribute name="item" type="Camping_Item__c" required="True" />
<ui:outputText value="{!v.item.Name}"/>
<ui:outputText value="{!v.item.Price}"/>
<ui:outputText value="{!v.item.Quantity}"/>
<ui:outputText value="{!v.item.Packed}"/>
<lightning:formattedNumber value="{!v.item.Price__c}" style="currency"/>
<lightning:formattedNumber value="{!v.item.Quantity__c}" style="number"/>
<lightning:input type="toggle" label="Packed" name="Packed" checked="{!v.item.Packed__c}"/>
</aura:component>
<aura:component >
<aura:attribute name="item" type="Camping_Item__c"
required = "true"
default="{!v.item.name +
v.item.Price__c +
v.item.Quantity__c +
v.item.Packed__c}"/>
<p>Name:
{!v.item.name}
</p>
<p>Price:
<lightning:formattedNumber value="{!v.item.Price__c}" style="currency"/>
</p>
<p>Quantity:
<lightning:formattedNumber value="{!v.item.Quantity__c}" style="decimal"/>
</p>
<p>
<lightning:input type="toggle"
label="Packed Status"
name="Packed Status"
checked="{!v.item.Packed__c}" />
</p>
</aura:component>