Closed goetzrobin closed 1 year ago
@timdeschryver just updated my PR. I went ahead and implemented this structure:
{
"required": {
"details": true,
"message": "Password is required"
},
"minLength": {
"details": {
"currentLength": 0,
"minLength": 5
},
"message": "Password must be at least 5 characters long. Add at least 5 characters"
},
}
I actually really like it! The current implementation also allows you to provide a default error message for your validator and override it on a field level!
I am blown away how powerful this is already!
:tada: This PR is included in version 1.0.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
directive renders an error component and provides injector that allows access to the underlying form field. the injected form field can then be used to render the errors.
the error component is provided through an injection token and can therefore be configured as needed. if no component is provided we throw an error
just a prototype but maybe it's useful!