You need to sign in to do that
Don't have an account?
Jennifer Blankenship 12
Trailhead Lightning Component Question
this is why i don't code..... I don't understand it
I'm working on Create a Lightning Compnent..... any help would be appreciated.
Thanks!
I'm working on Create a Lightning Compnent..... any help would be appreciated.
Thanks!
Go at the end of your code and write: </
the autocompletion should add something like:
</aura:component>
All Answers
Go at the end of your code and write: </
the autocompletion should add something like:
</aura:component>
Are you here?
https://trailhead.salesforce.com/en/projects/quickstart-lightning-components/steps/quickstart-lightning-components4
By the way, you just don't need the </aura:component> tags here in the controller (neither the figure 8).
These projects and modules around the Lightning components are the most difficult to understand at the beginning but with some explanations, it is not so complicated you are starting so it is normal that you don't find that easy.
Alain
Challenge Not yet complete... here's what's wrong:
The component does not include a 'aura:handler'
If I understand right, the aura:handler should be in the MyContactList.cmp. I put it at the bottom.
<lightning:card iconName="standard:contact" title="{! 'Contact List for ' + v.Account.Name}">
<!-- Contact list goes here -->
</lightning:card>
</aura:component>
<aura:handler name="init" value="{!this}" action="{!c.myAction}" />
Jennifer
5. Click the MyContactList.cmp tab and add the following markup below the last aura:attribute tag
<aura:handler name="init" value="{!this}" action="{!c.myAction}" />
https://trailhead.salesforce.com/en/projects/quickstart-lightning-components/steps/quickstart-lightning-components3
You will get it soon, Jennifer.
Let me know if you have other problems.
If you are more confortable with the copy/paste of code, that could help for your next badges
Copy : CTRL + C
Paste : CTRL + V (into the window < > ( Add a code sample) here)
Alain
<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:card>
</aura:component>
<aura:handler name="init" value="{!this}" action="{!c.myAction}" />
<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:card>
</aura:component>
<aura:handler name="init" value="{!this}" action="{!c.myAction}" />
This is the error i get
Failed to save MyContactList.cmp: 0Ad41000000jjVT:19,2: ParseError at [row,col]:[20,2] Message: The markup in the document following the root element must be well-formed.: Source
Jennifer
<aura:attribute name="recordId" type="Id" />
<aura:attribute name="Account" type="Account" />
<aura:attribute name="Contacts" type="Contact" />
<aura:attribute name="Columns" type="List" />
<aura:handler name="init" value="{!this}" action="{!c.myAction}" />
<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:card>
</aura:component>
That is just the position of the aura:handler below the last attribute.
- Each kind of tag between < and > has a start tag and a end tag and they are all nested.
- <aura:component> : the start tag for the end tag.</aura:component >
- There is a shorter way to write that with: <aura:handler .. /> (auto-closed tag) that is equivalent to <aura:handler .. > </aura:handler>
Alainjust below: <aura:attribute name="Columns" type="List" />
</aura:component> is always the last Aura tag of a component because the first Aura tag is <aura:component>
Alain
Ok great - why didn't the instructions say that. It finally saved but I still get an error on verification of the module
hallenge Not yet complete... here's what's wrong:
The 'MyContactList' component was not found.
I went into my dev and found this
Where are you now? (step 3, 4 or 5?)
4. Retrieve a Contact List
5. Render and Preview the Contact List
https://trailhead.salesforce.com/fr/projects/quickstart-lightning-components/steps/quickstart-lightning-components4
Alain
https://trailhead.salesforce.com/en/projects/quickstart-lightning-components/steps/quickstart-lightning-components2
Did you create this class? Alain
@AuraEnabled
public static List<Contact> getContacts(Id recordId) {
return [Select Id, FirstName, LastName, Email, Phone From Contact Where AccountId = :recordId];
}
Alain
Very good. I hope you will get this badge for the Lightning developer soon (the most complicated challenges).
Alain