3

I've got a few text-input helper like this

{{input type="text" valueBinding="name" focus-out="focusOutName"}}

I just upgraded Ember to 1.11.0 and now get this deprecation warning:

DEPRECATION: You're attempting to render a view by passing valueBinding to a view helper, but this syntax is deprecated. You should use value=someValue instead.

However when using value it is not bound in the controller and value simply sets the text to whatever value.

How do I correctly bind it?

Hedge
  • 16,142
  • 42
  • 141
  • 246
  • I am not sure what do you mean by **value is not bound in the controller** and also by **simply sets the text to whatever value**? For the second part, isn't that what input field is suppose to do, set text to a typed in value? – nem035 Apr 01 '15 at 16:41

1 Answers1

9

You should just have to change:

{{input type="text" valueBinding="name" focus-out="focusOutName"}}

to:

{{input type="text" value=name focus-out="focusOutName"}}

or even better (don't need the type="text", it's automatic):

{{input value=model.name focus-out="focusOutName"}}

then next to it you can display the value, and see it change when you change the input (so you can test for yourself that the bindings are set up already):

{{input value=model.name focus-out="focusOutName"}}
{{model.name}}
Kori John Roys
  • 2,621
  • 1
  • 19
  • 27