How to display accounts with contacts in salesforce lighnting
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAWsnMImAQ1gC_de0Hs9W8391Vq4dfZlvNgzLOL_AFF9OsgSQMnmjcskRFfbTdfktiS2cbYbnDaCjqCKysOvjjnPW_9xz9LkCnSylBgFXQutyr9K1x_NsUfLTQD5HYoyeFbCOKeb6C7yc/s1600/blog2.png)
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"> ...