Closed chenghanlee closed 9 years ago
It works you are probably passing a custom error message as the first argument of a validator and you should pass null
as the first and an error message as the second.
// WRONG!
Validators.string('HAS TO BE STRING!');
// CORRECT!
Validators.string(null, 'HAS TO BE STRING!');
Ah. I must have missed this in the documentation. Thank you for the explanation.
No problem :-)
Hi Jagi,
We can't seem to set a custom error message for type validators, e.g. Validators.number, Validators.string, and etc., at their constructions.
Currently, it seems like using "validatorError" event is the only way to return custom error message for type validators.
It will be nice if we can customize error messages for type validators during the validator construction like we can for size validators.
Thank you.