The component the behavior belongs to.
The controller of the behavior's component.
The element the behavior was attached to.
The form that the model belongs to.
The field name that is used in the form.
The key path to the model's value.
A flag that indicates that a change to the modelwas triggered internally.
Initializes native form elements by addingrequired validators.
Updates the value property of the componentwhenever the modal has changed.
Updates the model's value whenever the property ofthe component has changed.
The Model behavior connects a component to a parent Form.It also sets up a two way binding to the path inside the local scopethat is defined in the attribute's value.
Native form elements are working with form validation out of the box.
For custom components that should hook into the form validation yourimplementation must set the value property of the component instanceevery time the model's value should change. Of course a change in themodel's value will update the value property.
Example
<input name="username" type="text" model="username"/><input name="email" type="email" model="email"/><input name="birthday" type="date" model="birthday"/><input name="rating" type="number" model="rating"/><select name="suggestion" model="suggestion"> <option>Yes</option> <option>No</option></select>
{ default } from mahalo/behaviors/model