Last active
November 9, 2015 21:11
-
-
Save strrife/296ce1ece8703d28454f to your computer and use it in GitHub Desktop.
jQuery dead-simple mvc.
This file contains 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
(function bindDeadSimpleMvc($) { | |
var updateBindings = function () { | |
console.log($(this).attr('placeholder')); | |
$('[data-bind="' + $(this).attr('data-bind-variable') + '"]').html($(this).val()); | |
}; | |
$('input[data-bind-variable]').on('change keyup', updateBindings).each(updateBindings); | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment