Closed rehdie closed 1 year ago
makes sense and sounds useful. pr?
I haven’t looked at the autoTips example closely enough.
It seems to be easier to wrap these validators like in the example and return the localized messages in the error object directly (see MyValidators.maxLength).
I‘m closing this issue since there is already a way to implement the desired feature.
What problem does this feature solve?
Allow autoTips to contain values from the validation-Errors.
For example:
If a form-control has a validator of type Validators.max(65535), it is currently not possible, to add the 65535 into the autoTip, if validation fails.
What does the proposed API look like?
One solution could be: in addition to a Record<string, Record<string, string>> allow a function as a value for the nzAutoTip in NzFormDirective. It may look like this:
and in the NzFormControlComponent:
This way the user of NG ZORRO has full flexibility how to retrieve the messages for nzAutoTips.
A simple function to retrieve the error message for the autoTips may look like this: