Which directive is used in template-driven forms to track the state and validity of form controls?

  • [formGroup]
  • [formControl]
  • [ngModel]
  • [formStatus]
In template-driven forms, the [ngModel] directive is used to track the state and validity of form controls. It allows you to access information about the control's state, such as whether it's valid, touched, or dirty. This is crucial for implementing form validation and displaying error messages based on the control's state. The other options, [formGroup] and [formControl], are typically used in reactive forms.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *