Last active
June 17, 2017 04:27
-
-
Save joselo/c23a8b56e3184e1209d37c67ada56b23 to your computer and use it in GitHub Desktop.
Dispatch and listen event in polymer
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
// Dispatch | |
var event = { | |
bubbles: false, | |
composed: true, | |
detail: { | |
criteria: selectedCriterion | |
} | |
} | |
this.dispatchEvent(new CustomEvent('event', event)); | |
// Listener | |
ready() { | |
super.ready(); | |
this.addEventListener('event', e => this._handleEvent(e)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment