I just released a new version of my vadacl validation library for Angular 2. The new release includes the following updates:
-
To match a recent change to the pattern Validator in Angular 2, vadacl's pattern validation method was updated to accept both string and RegExp pattern arguments.
-
A requiredTrue validation method was added to parallel the recently-added Angular requiredTrue Validator (used primarily for validating that a checkbox has been checked/set to true).
-
The applyCollectionRule() method was added to the Vadacl class. The new method is designed to be used instead of the applyRules() method when applying a single validation method to a FormGroup or FormArray.
-
Added three new validation methods specifically for FormGroup and FormArray validation:
-
totals: validates that the sum of the numeric values of the FormGroup or FormArray controls equals a certain amount.
-
equalValues: validates that all of the values of the FormControls within a FormGroup or FormArray are exactly equal. Useful for performing password confirmation.
-
withinTrueCount: validates that the number of FormControls within a FormGroup or FormArray with a value of Boolean true falls within a given range. Designed primarily to validate how many checkboxes are checked.
-
-
Added and updated demos to demonstrate the new validation methods.
-
Updated the demo codebase to Angular 2.4.1