Created
March 27, 2020 05:45
-
-
Save karkranikhil/92146067ddf62e1ad24f72445532372d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <lightning-card title="one way data binding demo" icon-name="custom:custom1"> | |
| <div class="slds-p-around_medium"> | |
| <h1>My full name is {fullname}</h1> | |
| </div> | |
| </lightning-card> | |
| <lightning-card title="Two way data binding demo" icon-name="custom:custom2"> | |
| <div class="slds-p-around_medium"> | |
| <lightning-input | |
| type="text" | |
| name="title" | |
| label="Enter your title" | |
| value={title} | |
| onkeyup={changeHandler} | |
| > | |
| </lightning-input> | |
| </div> | |
| <div class="slds-p-around_medium"> | |
| <p>My title is {title}</p> | |
| </div> | |
| </lightning-card> | |
| </template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { LightningElement, track } from 'lwc'; | |
| export default class DataBinding extends LightningElement { | |
| fullname = "Salesforce troop" | |
| // @track title ="Salesforce developer" | |
| title ="Salesforce developer" | |
| changeHandler(event){ | |
| this.title = event.target.value | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> | |
| <apiVersion>48.0</apiVersion> | |
| <isExposed>true</isExposed> | |
| <targets> | |
| <target>lightning__AppPage</target> | |
| <target>lightning__RecordPage</target> | |
| <target>lightning__HomePage</target> | |
| </targets> | |
| </LightningComponentBundle> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment