Skip to content

Instantly share code, notes, and snippets.

@ithayer
Created December 14, 2011 22:25
Show Gist options
  • Save ithayer/1478849 to your computer and use it in GitHub Desktop.
Save ithayer/1478849 to your computer and use it in GitHub Desktop.
<!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