JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://cloud.github.com/downloads/emberjs/ember.js/ember-0.9.5.min.js"></script>
<script type="text/x-handlebars">
{{view App.TextField}}
{{view App.SubmitButton}}
</script>
JavaScript
App = Ember.Application.create({});
App.TextField = Em.TextField.extend({
valueBinding: 'App.TextValue.value',
keyUp: function(e){
if(e.keyCode == 13){ // This is enter, this works
// Try clicking button while still focused on
// text field and changing the value.
alert('Submitted: ' + App.TextValue.get('value'));
}
}
});
App.TextValue = Em.Object.create({
value: ''
});
App.SubmitButton = Em.Button.extend({
click: function() {
alert(App.TextValue.get('value'));
}
});