<force:inputField> can be usedto refer object’s fields in Lighting Component.
Sample Code:
Sample Code:
<aura:component implements=”force:appHostable”>
<aura:attribute name=”oppty”
type=”Opportunity”
default=”{ ‘sobjectType’: ‘Opportunity’}”/>
<div class=”slds-box slds-theme_default”>
<div class=”slds-grid slds-grid_vertical”>
<div class=”slds-col”>
Name<force:inputField value=”{!v.oppty.Name}”/>
</div>
<div class=”slds-col”>
Amount<force:inputField value=”{!v.oppty.Amount}”/>
</div>
</div>
</div>
</aura:component>
Output: