Individual form control validation trigger. #1600
-
Hi! Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Open the Stackblitz sample, or check the TypeScript tab. |
Beta Was this translation helpful? Give feedback.
-
Clarity uses the underlying Anyway, in Angular, you can mark a single form as touched by calling its |
Beta Was this translation helpful? Give feedback.
Clarity uses the underlying
NgControl
for touched and validation state. TheClrForm#markAsTouched
is just a way to mark all controls in the form as touched. (Side note: I'm not entirely sure why this method exists because you can do the same thing using theFormGroup#markAllAsTouched
method (NgForm#form
will give you theFormGroup
for a template form). MaybeFormGroup#markAllAsTouched
didn't exist whenClrForm#markAsTouched
was added. I am not sure.)Anyway, in Angular, you can mark a single form as touched by calling its
markAsTouched
method. Then, in order to update the validity state to show the validation messages, you need to callupdateValueAndValidity
. Again, this is not a Clarity-…