This file contains 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
<aura:application extends="force:slds"> | |
<div class="slds-box slds-text-heading_large slds-text-align_center"> | |
Lightning Web Component - Apex Hours | |
<div class=" slds-grid slds-gutters slds-align_absolute-center slds-wrap"> | |
<div class="slds-size_8-of-12"> | |
<c:EventDemo /> | |
</div> | |
</div> | |
</div> | |
</aura:application> |
This file contains 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
({ | |
lwcEventHandler : function(component, event, helper) { | |
var eventData = event.getParam('v'); | |
component.set("v.textFromEvent",eventData); | |
} | |
}) |
This file contains 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
<aura:component> | |
<aura:attribute name="textFromEvent" type="String" /> | |
<div class="slds"> | |
In Parent Lightning Component : {!v.textFromEvent} | |
<c:linkToAnotherCmp ontxtChange = "{!c.lwcEventHandler}" /> | |
</div> | |
</aura:component> |
This file contains 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 } from 'lwc'; | |
export default class LinkToAnotherCmp extends LightningElement { | |
raiseEvent(event){ | |
let txtInput = this.template.querySelector(".txtInput"); | |
const v = txtInput.value; | |
const textChangeEvent = new CustomEvent('txtChange',{ | |
detail : {v}, | |
}); |
This file contains 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> | |
<div> | |
I'm Lightning Web Component | |
<br/> | |
Input : <input class="txtInput" /> | |
<lightning-button label="Send to Aura Component" onclick={raiseEvent}></lightning-button> | |
</div> | |
</template> |
This file contains 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" fqn="helloWorld"> | |
<apiVersion>45.0</apiVersion> | |
<isExposed>true</isExposed> | |
<targets> | |
<target>lightning__AppPage</target> | |
<target>lightning__RecordPage</target> | |
<target>lightning__HomePage</target> | |
</targets> | |
</LightningComponentBundle> |
This file contains 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 HelloWorld extends LightningElement { | |
@track greet = 'Beautiful World'; | |
onNameChange(event) { | |
this.greet = event.target.value; | |
} | |
} |
This file contains 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="HelloWorld" icon-name="standard:custom_notification"> | |
<div class="slds-m-around_medium slds-p-around_small"> | |
<p>Welcome to, {greet}!</p> | |
<lightning-input label="Name" value={greet} onchange={onNameChange}></lightning-input> | |
</div> | |
</lightning-card> | |
</template> |
This file contains 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
({ | |
testEvalLocal : function(component, event, helper) | |
{ | |
console.log('inside testEvalLocal'); | |
window.foo = 1; | |
function bar() { | |
var foo = 2; | |
return eval("foo"); | |
} | |
var val = bar(); |
This file contains 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
<aura:component > | |
<!--Billing--> | |
<div> | |
UI Billing | |
</div> | |
<lightning:button label="testEvalLocal" onclick="{! c.testEvalLocal}"/> | |
</aura:component> |