There is a way to avoid writing all the rules again?
Hi,
I created a simple angular 2 custom validator for my purposes.
The validator uses this class-validator lib to validate the form control.
You can find the source code here:
DynaValidator
and the complete example project here:
Example-Dynamic-Form-And-Validation
I know it is not perfect or really performant, but it works for my use case.
I hope there is a better solution soon.
Wow that's very interesting !!!
I was thinking of having this kind of validation which is somehow not attached to Angular but consumed by it. This way, the same model class can be used server side for validation.
Good job!
@mesche Congratulations on your work. It was excellent! Your code will help me a lot. Thank you!
Most helpful comment
Hi,
I created a simple angular 2 custom validator for my purposes.
The validator uses this class-validator lib to validate the form control.
You can find the source code here:
DynaValidator
and the complete example project here:
Example-Dynamic-Form-And-Validation
I know it is not perfect or really performant, but it works for my use case.
I hope there is a better solution soon.