Lightning Component :
Create a below given component
<aura:component implements="force:appHostable" >
<aura:attribute name="conObj" type="Contact" default="{ 'sobjectType': 'Contact'}"/>
<div class="slds-box">
Account : <force:inputField aura:id="myAcc" value="{!v.conObj.AccountId}"/>
</div>
<lightning:button label="Save" onclick="{!c.save}"/>
<lightning:button label="Clear" onclick="{!c.clear}"/>
</aura:component>
JavaScript Controller :
Get record Id in JS Controller
save : function(component, event, helper){
var accountId = component.find("myAcc").get("v.value");
},
clear : function(component, event, helper){
// Clear binded value
var contactObj = component.get('v.conObj');
contactObj.AccountId = null;
component.set('v.conObj', contactObj);
// Clear product lookup
var accountLookup = component.find('LeasingContact').get('v.body')[0];
accountLookup.updateValues();
},