ng2-validation icon indicating copy to clipboard operation
ng2-validation copied to clipboard

why not keep the same error style with angular built-in validators?

Open fishen opened this issue 7 years ago • 1 comments

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}}

fishen avatar May 19 '17 07:05 fishen

I did this change in rangeLength in my project.

xinwangw avatar Aug 21 '17 05:08 xinwangw