Skip to content

Instantly share code, notes, and snippets.

@joeletizia
Created April 22, 2014 15:56
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 joeletizia/11184574 to your computer and use it in GitHub Desktop.
Save joeletizia/11184574 to your computer and use it in GitHub Desktop.
Elemental / Data Presents Pattern
presenters.ClickerAlert = function(element) {
$(element).on('click', showAlert);
function showAlert(){
alert("Hey, you clicked me!");
}
}
(function($, ns) {
ns('clicker-alert', {
initialize: function(){
new presenters.ClickerAlert(this);
}
});
})($, initializers);
<body>
<div class='foo' data-presents='clicker-alert' />
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment