Skip to content

Instantly share code, notes, and snippets.

@alexbaulch
Last active August 29, 2015 14:25
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 alexbaulch/29923f0565e0b066a13a to your computer and use it in GitHub Desktop.
Save alexbaulch/29923f0565e0b066a13a to your computer and use it in GitHub Desktop.
events.subscribe('button-clicked', function(data) {
alert(data.text);
});
$('button').on('click', function(e) {
e.preventDefault();
events.publish('button-clicked', {
text: $(this).text()
});
});
$('a').on('click', function(e) {
e.preventDefault();
events.publish('button-clicked', {
text: $(this).text()
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment