-
-
Save walski/642689 to your computer and use it in GitHub Desktop.
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
/*global Handlebars */ | |
// "jsonp!/user/123?callback=?", "text!/user.mustache" | |
var userData = { | |
name: "Thorben" | |
}; | |
//var userData = Model.new({ | |
// name: "Thorben" | |
//}); | |
require( | |
["text!user.mustache", "handlebars"], | |
function(userTemplate) { | |
var view = Handlebars.compile(userTemplate); | |
$("#app").html(view(userData)); | |
//$(userData).bindToView(view); | |
$(userData).bind("changeData", function() { | |
$("#app").html(view(userData)); | |
}); | |
} | |
); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Megagut</title> | |
<script src="requireplugins-jquery-1.4.3.js" data-main="app.js" type="text/javascript" charset="utf-8"></script> | |
</head> | |
<body> | |
<div id="app"> | |
</div> | |
</body> | |
</html> |
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
<div id="user"> | |
Hi {{name}} | |
</div> | |
<input type="text" name="name" value="" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment