Ember.TextFieldBinding value for parentView

I am trying to bind Ember.TextField valueto a property in the parent view. This code worked before upgrading to the latest version of ember. I read about a new field of view, but I can’t understand if it is applicable here / how it is.

Template my-template:

    Input: {{view Ember.TextField valueBinding="theValue" }}

View:

App.MyView = Em.View.extend({
    templateName: 'my-template',
    theValue: null,
    init: function(){
        this._super();
        this.set('theValue','');
    },
    keyDown: function(e){
       if(e.keyCode === 13){
            alert(this.get('theValue'));
       }
    }
});​

jsFiddle: demo

I tried "parentView.theValue"and"view.parentView.theValue"

I know that I can give TextFielda viewNameand bind to it internally MyView, but I want to know why the previous method stops working.

Update:

+5
source share
2 answers

I updated your jsFiddle to work: http://jsfiddle.net/U3thg/23/

valueBinding "view.theValue".

 {{view Ember.TextField valueBinding="view.theValue" }}
+8

, . , ember . , - , .

@ebryn:

http://jsfiddle.net/Sly7/tcvhB/

+4

All Articles