Last active
October 13, 2015 21:58
-
-
Save webOS101/4261859 to your computer and use it in GitHub Desktop.
Event Sample
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
<script> | |
new Subscriber().renderInto(document.body); | |
</script> |
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
enyo.kind({ | |
name: "MyKind", | |
handlers: { ontap: "mytap" }, | |
events: { onMyEvent: "" }, | |
content: "Click for the answer", | |
mytap: function() { | |
this.doMyEvent({ answer: 42 }); | |
} | |
}); | |
enyo.kind({ | |
name: "Subscriber", | |
components: [ { kind: "MyKind", onMyEvent: "answered" }], | |
answered: function(inSender, inEvent) { | |
alert("The answer is: " + inEvent.answer); | |
return(true); | |
} | |
}); |
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
name: Event Sample | |
description: Sending and receiving events | |
authors: | |
- Roy Sutton | |
normalize_css: no |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment