0
votes

I've to ask for a question/problem that I'm having, in a view like this one:

Ember.View.create(
  templateName: "testForm"
  fieldName: "test-0"
)

I've a textField into the template where I'm trying to pass a custom valueBinding, like so:

{{view Ember.TextField placeholder="Title" valueBinding='view.fieldName'}}

why ember doesn't set the correct value binding? Ember is setting just a 'value''s html attribute that I can see viewing the HTML source code with 'test-0' value, but isn't binded.

Anyone have any idea?

1

1 Answers

0
votes

When you create a view with default values they need to be in a hash, notice the brackets

Em.View.create({
    templateName: 'testForm',
    fieldName: 'test-0'
});

Second valueBinding is using single quotes instead of double quotes. It should be valueBinding="view.fieldName"

Other than those two things it works, see http://jsfiddle.net/mlienau/zUDKZ/ for clarity.