You need to sign in to do that
Don't have an account?
Gopal Singh 17
Uncaught (in promise) TypeError: t[Yn] is not a function
I am getting this error while iterating data under template tag in llightning web component.
<template>
<lightning-card title="EventWithData" icon-name="standard:logging">
<div class="slds-m-around_medium">
<template if:true={contacts.data}>
<p>Gopal Singh</p>
<template for:each={contacts} for:item='con'>
<p key={con.id}>{con.Title}</p>
</template>
</template>
</div>
</lightning-card>
</template>
import { LightningElement, wire } from 'lwc';
import getContactList from '@salesforce/apex/ContactController.getContactList';
export default class EventWithData extends LightningElement {
//@track selectedContact;
@wire(getContactList) contacts;
}
<template>
<lightning-card title="EventWithData" icon-name="standard:logging">
<div class="slds-m-around_medium">
<template if:true={contacts.data}>
<p>Gopal Singh</p>
<template for:each={contacts} for:item='con'>
<p key={con.id}>{con.Title}</p>
</template>
</template>
</div>
</lightning-card>
</template>
import { LightningElement, wire } from 'lwc';
import getContactList from '@salesforce/apex/ContactController.getContactList';
export default class EventWithData extends LightningElement {
//@track selectedContact;
@wire(getContactList) contacts;
}
Greetings to you!
Iterate over contacts.data. Please try below code:
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas