-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fire message to other element #1045
Comments
The fired event bubbled just like native DOM events so you han catch it On Mon, Dec 22, 2014, 02:26 Gert Cuykens notifications@github.com wrote:
|
hmm ok I am missing something, can't figure it out how to do that. <polymer-element name="my-hover">
<script>
Polymer({
ready: function(){
document.addEventListener('my-hover', function(e) {
console.log(e.type, e.detail.msg);
});
}
});
</script>
</polymer-element> <polymer-element name="my-fire">
<script>
Polymer({
test: function(){
var event = new CustomEvent("my-hover", { "msg": "Example of an event" });
document.dispatchEvent(event)
});
</script>
</polymer-element> Going to make a jsbin |
lol it works http://jsbin.com/yelim :) but hang on I managed to break it in my app need some time to find the difference. |
Goddamit every freaking time I forget this |
You can also do Instead of
|
ok thanks |
https://www.polymer-project.org/docs/polymer/polymer.html#fire
Can
this.fire
something to another element?Example
The text was updated successfully, but these errors were encountered: