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
NgControlfor touched and validation state. TheClrForm#markAsTouchedis 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#markAllAsTouchedmethod (NgForm#formwill give you theFormGroupfor a template form). MaybeFormGroup#markAllAsToucheddidn't exist whenClrForm#markAsTouchedwas added. I am not sure.)Anyway, in Angular, you can mark a single form as touched by calling its
markAsTouchedmethod. Then, in order to update the validity state to show the validation messages, you need to callupdateValueAndValidity. Again, this is not a Clarity-…