for 3aeach in lwc js

Solutions on MaxInterview for for 3aeach in lwc js by the best coders in the world

showing results for - "for 3aeach in lwc js"
Martin
13 May 2020
1<template>
2    <lightning-card title="Account List using for:each" icon-name="custom:custom63">
3        <div class="slds-m-around_medium">
4            <template if:true={accounts.data}>
5                <template for:each={accounts.data} for:item="acc">
6                    <p key={acc.Id}>{acc.Name}</p>
7                </template>
8            </template>
9            <template if:true={accounts.error}>
10                {accounts.error}
11            </template>
12        </div>
13    </lightning-card>
14</template>
15
Alejandro
19 Oct 2016
1<template for:each={lstAccounts} for:item="acc">
2    <p key={acc.Id} style="display:inline">
3        <lightning-badge label={acc.Name}></lightning-badge>
4    </p>
5</template>
Christopher
02 Oct 2018
1import { LightningElement, wire } from 'lwc';
2import getAccountList from '@salesforce/apex/AccountHelper.getAccountList';
3export default class AccountListForEachLWC extends LightningElement {
4    @wire(getAccountList) accounts;
5}
6
Ben
04 Jan 2021
1public with sharing class AccountHelper {
2    @AuraEnabled(cacheable=true)
3    public static List<Account> getAccountList() {
4        return [SELECT Id, Name, Type, Rating,
5                Phone, Website, AnnualRevenue
6            FROM Account];
7    }
8}
9