• Anderson Cardoso 10
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 1
    Replies
For challenge "Create a Lightning Component", I am getting the error listed below. I was able to get through all of the other modules except this one. What am I missing? 

Error: Challenge Not yet complete... here's what's wrong:  The component does not contain the correct lightning:card markup.

User-added image

MyContactList.cmp
<aura:component controller="MyContactListController" implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" >
	<aura:attribute name="recordId" type="Id" />
<aura:attribute name="Account" type="Account" />
<aura:attribute name="Contacts" type="Contact" />
<aura:attribute name="Columns" type="List" />

<force:recordData aura:id="accountRecord"
                  recordId="{!v.recordId}"
                  targetFields="{!v.Account}"
                  layoutType="FULL"
                  />

<lightning:card iconName="standard:contact" title="{! 'Contact List for ' + v.Account.Name}">
    <!-- Contact list goes here -->
    <lightning:datatable data="{! v.Contacts }" columns="{! v.Columns }" hideCheckboxColumn="true"/> 

</lightning:card>

    <aura:handler name="init" value="{!this}" action="{!c.myAction}" />
</aura:component>
MyContactListControllers.js
({
	myAction : function(component, event, helper) {
		component.set("v.Columns", [
    {label:"First Name", fieldName:"FirstName", type:"text"},
    {label:"Last Name", fieldName:"LastName", type:"text"},
    {label:"Phone", fieldName:"Phone", type:"phone"}
]);
        var action = component.get("c.getContacts");
action.setParams({
    recordId: component.get("v.recordId")
});
action.setCallback(this, function(data) {
    component.set("v.Contacts", data.getReturnValue());
});
$A.enqueueAction(action);

	}
})

Thanks in advance!
  • February 02, 2018
  • Like
  • 0