ng2-validation
ng2-validation copied to clipboard
why not keep the same error style with angular built-in validators?
I use both CustomValidators and built-in validators in my project, I found that CustomValidators include multi error info in one object:
({digits: true, actualValue: 2.3, requiredValue: 2, max: true})
this is built-in validators error object:
{"minlength":{"requiredLength":4,"actualLength":1}}
and look this case (just for test):
CustomValidators.min(10), CustomValidators.max(2)
{"actualValue":8,"requiredValue":2,"min":true,"max":true}
it wiill mix-in the all error info in one object !
why not use the same style with the built-in validators for the complex error info ???
{"required":true,"minlength":{"requiredLength":4,"actualLength":1},"max":{"actualValue": 2.3, "requiredValue": 2}}
I did this change in rangeLength in my project.