We upgraded to Ember 1.11.1 and Ember-validations 2.0.0-alpha.3.
Controller
export default Ember.Controller.extend(EmberValidations.Mixin, {
canValidate: true,
validationModel: Ember.computed.alias("model"),
validations: {
'validationModel.name': {
presence: { 'if': 'canValidate', message: 'Please enter a name'},
},
},
}
Template
{{log "error value" errors.validationModel.name}}
{{input classBinding="errors.validationModel.name:app_input_box_error:app_input_box" placeholder="Document Name" value=model.name}}
With the above template code in place, validations works as expected and the input's class is swopped out depending on whether there is a validation error or not. However, when the {{log}} line is removed, the class binding seems to be lost and the input class is no longer appropriately updated. Any advice on the cause/fix please?
Note Class bindings outside helpers e.g. in a standard div continues to work properly