Bind value and class to Ember.TextField

ember.js

Solution

what you are looking to do is as follows:

{{input type="text" value=name classBinding=":uk-width-1-1 errors.name:error" placeholder="Name" required=""}}

there is no need for a computed property here as long as error.name is truely a boolean value. in classBindings :uk-width-1-1 will always print and error will only be there if errors.name is true.

Just for reference, say you had a error and non-error class you wanted to use. You could do errors.name:error:non-error which would have error when errors.name is true and non-error when it is false.

Problem

i'm trying to bind two attributes to an Ember textfield, but it doesn't work. ``` {{input type="text" value=name class="uk-width-1-1" placeholder="Name" required="" }} ``` How can I bind an "error" class to this textfield when `errors.name` is true?

Original source