You need to sign in to do that
Don't have an account?
mohd areeb 8
Passing List of accounts to a picklist and displaying it in lightning web component
html
<select key={rel.Id} class="form-control" for:each={courseRels.data} for:item="rel">
<option >
{rel.Name}
</option>
</select>
js
@wire(getLocationList) courseRels;
apex controller
@AuraEnabled(cacheable=true)
public static List<Location__c> getLocationList() {
return [SELECT Id, Name FROM Location__c];
}
<select key={rel.Id} class="form-control" for:each={courseRels.data} for:item="rel">
<option >
{rel.Name}
</option>
</select>
js
@wire(getLocationList) courseRels;
apex controller
@AuraEnabled(cacheable=true)
public static List<Location__c> getLocationList() {
return [SELECT Id, Name FROM Location__c];
}