I would like to automatically highlight a Ember.TextField when the value in it is invalid.
I have something like this in my template right now that works but is ugly:
{{#if view.fieldInvalid}}
{{view Ember.TextField valueBinding="view.fieldValue" classNames="span1p5 highlight"}}
{{else}}
{{view Ember.TextField valueBinding="view.fieldValue" classnames="span1p5"}}
{{/if}}
Is there a way to do this in Ember.JS with a built-in view like Ember.TextField?
One way of doing this is adding a classname bindings with computed property
Now use the above defined in your handlebars
Important
The above code may satisfy your need but may slow down your application if there are many text-fields, as the computed property is executed for every single change in the value, it is better to have a save button action which on click may apply the CSS class to the textfield as follows