Ember Latest
The latest build of Ember.
HTML
<script src="http://builds.emberjs.com/handlebars-1.0.0-rc.4.js"></script>
<script src="http://builds.emberjs.com/ember-latest.js"></script>
<script type="text/x-handlebars" data-template-name="application">
<h1>Editable Content</h1>
<p>Content Editable is so cool, but we need to make Ember realize it! Edit the text below by clicking on it, and then hit save to see what Ember thinks it says</p>
<p class="editable" contenteditable=true>{{coolText}}</p>
<button {{action save}}>Save</button>
<p>P.S. this only works in <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Content_Editable">some browsers</a>.</p>
</script>
CSS
h1 {
font-size: 2em;
}
p {
padding: 10px;
margin-bottom: 10px;
}
.editable {
background-color: red;
}
JavaScript
App = Ember.Application.create({});
App.ApplicationController = Ember.Controller.extend({
coolText: "click on me to edit!",
save: function() {
window.alert(this.get('coolText'));
}
});