How To Access the Validation Status?
You can access your object property status, either to read it or to do some action on it.
This will help you to use the validators inside your forms, read more
1. Using provided methods:
the Validator
class provides the following methods for accessing the property status:
method | return | description |
---|---|---|
validateItem(key) | void | validate the item passed |
isItemValid(key) | boolean | undefined | check if the item is valid |
itemMessage(key) | string | undefined | return the message if the item is not valid |
2. Directly from .items
and .nested
properties:
to access the property status, you can use the .items
and .nested
properties directly of the validator
validator.items.property.<action>;
validator.nested.nestedProprty.items.property.<Ta>;
action is a function (or property) you want to access to, the item properties are of type ValidatorItem
.