Last active
June 1, 2021 23:35
-
-
Save hum-n/5ace4381aca7c19e7cd867362f8e8851 to your computer and use it in GitHub Desktop.
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 { component, customEvent, Element } from 'nativeweb'; | |
@component('first-component') | |
export class FirstComponent extends Element { | |
@event() ready = { | |
'other-component': this.onReady() | |
}; | |
onReady({ detail }) { | |
console.log(detail); | |
} | |
} | |
@component('other-component') | |
export class OtherComponent extends Element { | |
@customEvent() ready = 'Ready 🚀'; | |
connected() { | |
dispatchEvent(this.ready); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment