Module

lib/engine/ValidatorFactory

Factory for generating Angular ValidatorFn from Decaf validation metadata.

View Source lib/engine/ValidatorFactory.ts, line 2

Methods

# inner resolveValidatorKeyProps(key, value, type)

Resolves the correct validator key and its associated properties based on the input key and type.

Resolves the correct validator key and its associated properties based on the input key and type.

When the validation key is TYPE, it's necessary to resolve the actual validator based on the field's type (e.g., 'password', 'email', 'url') instead of using the generic getValidator("type") logic. This allows directly invoking specific validators like getValidator('password'), ensuring the correct behavior for type-based validation.

Parameters:
Name Type Description
key

The validation key (e.g., 'type', 'required', etc.).

value

The value that needs be provided to the validator.

type

The field's declared type.

View Source lib/engine/ValidatorFactory.ts, line 30

An object containing the resolved validator key and its corresponding props.