What Is Ng Dirty

What Is Ng Dirty

ng-dirty: The ng-dirty class tells that the form has been made dirty (modified ) by the user. It returns true if the user has modified the form. Return type: Return Boolean True if the form/input field is modified by the user else it returns False.

What is Ng touched?

ng-untouched The field has not been touched yet. ng-touched The field has been touched.

What is dirty in form validation?

To prevent the validator from displaying errors before the user has a chance to edit the form, you should check for either the dirty or touched states in a control. When the user changes the value in the watched field, the control is marked as “dirty”.

Sarah Jenkins
Author

Sarah Jenkins

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.