Last active
October 13, 2015 21:58
-
-
Save webOS101/4261885 to your computer and use it in GitHub Desktop.
Signal 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 App().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: "Signaller", | |
components: [ | |
{ kind: "Button", content: "Click", ontap: "sendit" } | |
], | |
sendit: function() { | |
enyo.Signals.send("onButtonSignal"); | |
} | |
}); | |
enyo.kind({ | |
name: "Receiver", | |
components: [ | |
{ name: "display", content: "Waiting..." }, | |
{ kind: "Signals", onButtonSignal: "update" } | |
], | |
update: function(inSender, inEvent) { | |
this.$.display.setContent("Got it!"); | |
} | |
}); | |
enyo.kind({ | |
name: "App", | |
components: [ | |
{ kind: "Signaller" }, | |
{ kind: "Receiver" } | |
] | |
}); |
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: Signal Sample | |
description: An example of using signals | |
authors: | |
- Roy Sutton | |
normalize_css: no |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment