Created
December 14, 2011 22:25
-
-
Save ithayer/1478849 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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<title>Ember Bug</title> | |
</head> | |
<body> | |
<script src="http://code.jquery.com/jquery-1.7.1.js"></script> | |
<script src="https://github.com/downloads/emberjs/ember.js/ember-0.9.1.js"></script> | |
<script type="text/x-handlebars" data-template-name="president"> | |
The President of the United States is {{name}}. | |
</script> | |
<script> | |
var MyApp = Ember.Application.create(); | |
$(document).ready(function() { | |
MyApp.president = Ember.Object.create({ | |
firstName: "Barack", | |
lastName: "Obama", | |
fullName: function() { | |
return this.get('firstName') + ' ' + this.get('lastName'); | |
// Call this flag to mark the function as a property | |
}.property('firstName','lastName') | |
}); | |
var firstView = Ember.View.create({ | |
templateName: 'president', | |
nameBinding: 'MyApp.president.fullName' | |
}); | |
firstView.append(); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment