Skip to Content

Validation

​​​​​​Set of properties to establish a specific validation rule.

Interface

interface IValidation { required: boolean; expression?: string | RegExp; expressionErrorMessage?: string | ILocales; minLength?: number; }

Properties

required

Indicates if the field is required.

  • Type: boolean

  • Required: Yes

expression

Regular expression to perform validation.

  • Type: string | RegExp

  • Required: No

  • Example:

"expression": "/^[^0-9]+$/"

expressionErrorMessage

Error message that will be displayed only if the regular expression is not met.

  • Type: string |Locales

  • Required: No

  • Example:

"expressionErrorMessage": { "en-US": "You can not use numbers in this field", "es-ES": "No puedes usar numeros en este campo" }

minLength

Specifies the minimum length that the field must have.

  • Type: number

  • Required: No

  • Example:

"minLength": 5
Last updated on