Getting started

Decorators

Components

Directive

Validators

Custom Validators

Error Message Elements

The gv-error-message elements are used to display error messages associated with specific form controls. They should be placed inside a div or any other container element alongside the corresponding input elements.

<gv-error-message>

Description: The <gv-error-message> element displays the error message associated with a specific form control. The name of the form control is provided as an attribute value to pair the error message with the correct form control.

Attributes:

Usage:

htmlCopy code
<div>
  <input type="text" formControlName="firstName">
  <gv-error-message name="firstName"></gv-error-message>
</div>

Nested FormArray and GVModel

The GV directive can also be used with nested FormArray elements. In this case, the GV directive should be applied to the parent div containing the nested FormArray, and the GVModel associated with the nested form controls should be specified as a model that extends from GVModel.

Nested <div formArrayName="companies">

Description: The div element with the attribute formArrayName="companies" represents the parent container for a nested FormArray named "companies." The GV directive is applied to this element, indicating that the validation rules for the nested form controls are defined by the GVUserModel1, which should be a model extending from GVModel.

Usage: