Core features of reactive form validators

Compare Password Cross Field Validation

Angular provides good validators but doesn’t fulfil enterprise application’s need with minimal line of code. Easily this can be achieved with rxweb validation framework.

If you want to apply compare validation on 'Confirm Password' field matched value with 'Password' field.

Conditional Validation

There is no need to create custom validators to manage the conditional validation and putting more if/else clause in the code to become messy code. Conditional Validation can be achieved with one line of code.

If you want to apply conditional required validation on 'Identity Number' then you need to add this input as 'India'.
If you want to apply conditional required validation on 'Identity Number' then you need to add 'Country Name' input as 'India'.

Dynamic Validation

Most of large scale enterprise application requires to apply form validation based on server rules. The most efficient way of rxweb to provide the dynamic form validation on FormControl without writing much lines of code.

If you want to apply dynamic validation on 'First Name'. This validate alphabets, required and max length upto 10 digit as per dynamic json configuration
{{userModelFormGroup.controls.firstName.errorMessage}}

Decorator based model based validation

Angular doesn’t provide model based FormGroup property binding. The major disadvantage of having more duplicate code in respective components. The rxweb provides validation decorators on property for managing code consistency and reusability purpose. Benefit of using this approach is code will be much cleaner and easy to use same class in other components.

If you want to apply validation as required and maxlength upto 20 characters
If you want to apply validation as required and not match with first name as different validation.
If you want to apply password validation. which contains alphabet, numeric, minlength upto 6 character and maxlength upto 10 charcter and contains lower and uppercase letters
If you want to apply compare validation. you need to compare with field 'Password'
If you want to apply email validation on this input.