To have model data be dispayed in a form, which can be validated.
model: Ember.Object.create({
name: 'Fred'
}),
form: validationProxy('model', {
presence: true
})
See the IndexController and template for an example.
form
is bound to the inputs, leavingmodel
alone.- The user can alter the
form
data, leavingmodel
alone. - The user submits the
form
- The
form
is validated - If validation is successful, the changes are transfered to the
model
itself.
This works fine, apart from an inconsistancy I noticed with htmlbars not adding a classname to the input when in an error state.
Notice in the screenshot bind-attr is displaying an error but htmlbars is not:
ember serve