Skip to content

Instantly share code, notes, and snippets.

@hum-n
Last active June 1, 2021 23:35
Show Gist options
  • Save hum-n/5ace4381aca7c19e7cd867362f8e8851 to your computer and use it in GitHub Desktop.
Save hum-n/5ace4381aca7c19e7cd867362f8e8851 to your computer and use it in GitHub Desktop.
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