How to display accounts with contacts in salesforce lighnting
Apex class ========== public class AccountDataController { @AuraEnabled public static List<Account> showAccountsData() { return [select Name,Site,AccountNumber from Account]; } @AuraEnabled public static List<Contact> showContactsData(String acctId) { List<Contact> returnconts=new List<Contact>(); for(Contact con:[select AccountId,Name,Email,Phone from Contact where AccountId=:acctId]) { returnconts.add(con); System.debug('contacts'+returnconts.size()); } return returnconts; } } Accountcomp.cmp =============== <aura:component controller="AccountDataController"> <aura:attribute name="acclist" type="list"/> <aura:attribute name="contactlist" type="list"/> <aura:attribute name="booleanvar" type="boolean" /> Conta