The Form
is a controller which keeps track of the validity of the widgets contained within it.
Property of the form and widget instance.
Summary of all of the errors on the page. If a widget emits $invalid
with REQUIRED
key,
then the $error
object will have a REQUIRED
key with an array of widgets which have
emitted this key. form.$error.REQUIRED == [ widget ]
.
Property of the form and widget instance.
True if any of the widgets of the form are invalid.
Property of the form and widget instance.
True if all of the widgets of the form are valid.
Upon receiving the $invalid
event from the widget update the $error
, $valid
and $invalid
properties of both the widget as well as the from.
validationKey – {string} –
The validation key to be used when updating the $error
object.
The validation key is what will allow the template to bind to a specific validation error
such as <div ng:show="form.$error.KEY">error for key</div>
.
Upon receiving the $valid
event from the widget update the $error
, $valid
and $invalid
properties of both the widget as well as the from.
validationKey – {string} –
The validation key to be used when updating the $error
object.
The validation key is what will allow the template to bind to a specific validation error
such as <div ng:show="form.$error.KEY">error for key</div>
.
Emit the $validate
event on the widget, giving a widget a chance to emit a
$valid
/ $invalid
event base on its state. The $validate
event is triggered when the
model or the view changes.
A widget is responsible for emitting this event whenever the view changes do to user interaction.
The event takes a $viewValue
parameter, which is the new value of the view. This
event triggers a call to $parseView()
as well as $validate
event on widget.
viewValue – {*} –
The new value for the view which will be assigned to widget.$viewValue
.