Skip to content

Instantly share code, notes, and snippets.

@choudharymanish8585
Created January 22, 2019 18:44
Show Gist options
  • Save choudharymanish8585/f98da573f3b5abfdfc9fb48ee79c39ea to your computer and use it in GitHub Desktop.
Save choudharymanish8585/f98da573f3b5abfdfc9fb48ee79c39ea to your computer and use it in GitHub Desktop.
<aura:component implements="flexipage:availableForRecordHome" access="global" >
<!--intantiating unsaved changed component -->
<lightning:unsavedChanges aura:id="unsavedData"
onsave="{!c.saveData}"
ondiscard="{!c.discardData}"/>
<lightning:card title="Create Account">
<!-- Handle name change, make unsaved changes in this action as user has typed some value-->
<lightning:input name="Name" aura:id="name" label="Enter name" onchange="{!c.handleDataChange}"/>
<!-- Handle phone change, make unsaved changes in this action as user has typed some value-->
<lightning:input name="Phone" aura:id="phone" type="tel" label="Enter phone number" onchange="{!c.handleDataChange}"/>
<!-- Handle save action, clear unsaved changes in this action -->
<lightning:button label="Save Account" onclick="{!c.saveAccount}" />
</lightning:card>
</aura:component>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment