Created
June 21, 2019 20:03
-
-
Save JitendraZaa/f75b14dc45d9ef5001f53974b7934c4e 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
div{ | |
background-color: #cccccc; | |
} |
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> | |
<div > | |
This is Tesla Component - {log} | |
</div> | |
<br /> | |
<c-model3 onmodelclick={modelClick}></c-model3> | |
</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 Child1 extends LightningElement { | |
@track log = ''; | |
modelClick(e){ | |
this.log = this.log + ' Captured event - '+ e.detail+' '; | |
const event = new CustomEvent('modelclick', { | |
// detail contains only primitives | |
detail: 'Event Started in Tesla' | |
}); | |
// Fire the event from model 3 | |
this.dispatchEvent(event); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment