You need to sign in to do that
Don't have an account?
Abhish Chalke
I am not able to see anything on my component
How to use for each in LWC
// @track colormapdata = []; @wire(getChildMFSOLegendData) portalPref({data,error}) { console.log('#####2',data); if (data) { //console.log('####inside if',portalPref.data); // this.colormapdata = data; // this.error = undefined; //this.colormapdata=data; //this.currentRowLimit = data.HSOP_RecordCount__c; //console.log('####data',this.colormapdata); } else if (error) { // this.colormapdata = undefined; //this.error = error; // console.log('The wire error: ' + error); } }
<template if:true={data}> <template for:each={data} for:item="cus"> <c-hrwdlegends name={cus.value.Display_Status_Value__c} colourcode={cus.value.Block_Color__c} key={cus.Id}>abcd</c-hrwdlegends> </template> </template>
I am not able to see anything on my component
>> https://niksdeveloper.com/salesforce/loop-through-list-in-lwc-and-javascript/#:~:text=To%20loop%20through%20List%20in%20LWC%2C%20we%20can%20make%20use,the%20elements%20in%20the%20Array.&text=To%20use%20iterator%3Ait%2C%20we,the%20Array%20to%20iterator%3Ait.
The above link has an example of a way to loop through data in LWC. can you try checking it?
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.
Thanks.