@linch90/od-validators
v3.0.0
Published
Provide complex validators for angular form
Downloads
12
Maintainers
Readme
- atLeastOne, at least one of the
controls
should satisfy the providedvalidator
.
atLeastOne = (validator, controls: string[] | null) => ...
- atLeastOneConditionally, at least one of the
controls
should satisfy the providedvalidator
if thedependedControl
has thedependedValue
.
atLeastOneConditionally = (
validator: ValidatorFn,
dependedControl: string,
dependedValue: any,
controls: string[] | null = null
) => ...
- requiredConditionally, make
controls
required, if thedependedControl
has thedependedValue
.
requiredConditionally = (
dependedControl: string,
dependedValue: any,
controls: string[] | null = null
) => ...
- requiredConditionally2, make
controls
required, if thedependedControl
has thedependedValue
and thedependedControl2
has thedependedValue2
.
requiredConditionally2 = (
dependedControl: string, dependedValue: any) =>
(
dependedControl2: string,
dependedValue2: any,
controls: string[] | null = null
) => ...
- conditionalValidator, apply
validator
ifpredicate
return true.
conditionalValidator =
(predicate: () => boolean, validator: ValidatorFn) => ...