Skip to main content
cngx-src documentation

requiredTrue

Functionforms/validators

projects/forms/validators/required-true.validator.ts

Description#

Validates that the control value is strictly true.

Returns { requiredTrue: { actual } } for any value other than true. Intended for checkbox agreement fields.

Near-duplicate of Angular's Validators.requiredTrue by design: the requiredTrue error kind and { actual } payload line up with the withErrorMessages registry keys.

Signature#

requiredTrue()

Returns#

ValidatorFn