Created
April 22, 2014 15:56
Elemental / Data Presents Pattern
This file contains hidden or 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
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); |
This file contains hidden or 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
<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