Example of an Aura component in Salesforce
Here's an example to display a list of contacts related to an account and add new contacts and update existing ones. <!-- ContactList.cmp --> <aura:component controller="ContactController"> <aura:attribute name="accountId" type="String" /> <aura:attribute name="contacts" type="List" /> <aura:handler name="init" value="{!this}" action="{!c.init}" /> <ul> <aura:iteration items="{!v.contacts}" var="contact"> <li>{!contact.Name}</li> </aura:iteration> </ul> </aura:component> ========================================================================== // ContactController.cls public with sharing class ContactController { @AuraEnabled public static List<Contact> getContacts(String accountId) { retu...