• Kavya Goel 9
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
I've spent hours trying to figure this challenge out and finally got it working, but now when I go to 'Check' the challenge, it's not giving me the credit I deserve! The task seems pretty straightforward, but i'm sure i'm missing some code they think is necessary. Like the teacher telling you that you "solved the problem wrong" even though you got the right answer...

Error is: Challenge Not yet complete... here's what's wrong: 
The campingListItem JavaScript controller isn't setting the 'item' attribute correctly.

------ campingListItem.cmp ------
<aura:component >
    <aura:attribute name="item" type="Camping_Item__c" default="{'sobjectType':'Camping_Item__c','Packed__c':false}"/>
    <p>Name:
        <ui:outputText value="{!v.item.Name}"/>
    </p>
    <p>Price:
        <ui:outputCurrency value="{!v.item.Price__c}"/>
    </p>
    <p>Quantity:
        <ui:outputNumber value="{!v.item.Quantity__c}"/>
    </p>
    <p>Packed:
        <ui:outputCheckbox aura:id="checkbox" value="{!v.item.Packed__c}"/>
    </p>
    <ui:button label="Packed!" press="{!c.packItem}"/>  
</aura:component>


------ campingListItemController ------
({
    packItem : function(component, event, helper) {
        component.set("v.item.Packed__c",true);
        event.getSource().set("v.disabled",true);
    }
})