Skip to content

Instantly share code, notes, and snippets.

@webOS101
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webOS101/427c441f1f3ce57bd739 to your computer and use it in GitHub Desktop.
Save webOS101/427c441f1f3ce57bd739 to your computer and use it in GitHub Desktop.
Signal Sample
enyo.ready(function() {
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(sender, event) {
this.set('$.display.content', 'Got it!');
}
});
new enyo.Application({
name: 'app',
view: {
components: [
{kind: 'Signaller'},
{kind: 'Receiver'}
]
}
})
});
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