Skip to content

Instantly share code, notes, and snippets.

@JitendraZaa
Created June 21, 2019 20:03
Show Gist options
  • Save JitendraZaa/f75b14dc45d9ef5001f53974b7934c4e to your computer and use it in GitHub Desktop.
Save JitendraZaa/f75b14dc45d9ef5001f53974b7934c4e to your computer and use it in GitHub Desktop.
div{
background-color: #cccccc;
}
<template>
<div >
This is Tesla Component - {log}
</div>
<br />
<c-model3 onmodelclick={modelClick}></c-model3>
</template>
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