Skip to content

Instantly share code, notes, and snippets.

@joeletizia
Created April 22, 2014 15:56
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