The code is supposed to read:
<lightning-card title="ContactInformation" icon-name="custom:custom14"> <div class="slds-m-around_medium">
<template for:each={contacts} for:item="contact">
<div key={contact.Id}> {contact.Name}, {contact.Title} </div> </template> </div> </lightning-card>
But I'm still getting an error, LWC1079: Expected root tag to be template, found lightning-card.
This is literally the code it says to use, and it still doesn't work. Is there a cache I need to delete, or something I need to reset? I', unable to deploy and configure the LWC.
Thanks,
Shaun
15 respuestas
Jonathan Fox (Cooper Parry) Forum Ambassador
<template>
<lightning-card title="ContactInformation" icon-name="custom:custom14">
<div class="slds-m-around_medium">
<template for:each={contacts} for:item="contact">
<div key={contact.Id}>
{contact.Name}, {contact.Title}
</div>
</template>
</div>
</lightning-card>
</template>
Try this. I added <template> tags to enclose your whole code.