Asked by: Nickole Gutkas
asked in category: General Last Updated: 10th May, 2020

What is pristine in AngularJS?

212. The ng-dirty class tells you that the form has been modified by the user, whereas the ng-pristine class tells you that the form has not been modified by the user. So ng-dirty and ng-pristine are two sides of the same story. The classes are set on any field, while the form has two properties, $dirty and $pristine .

Click to see full answer.


In this way, what's the difference between dirty touched and pristine in a form element?

pristine: This property returns true if the element's contents have not been changed. dirty: This property returns true if the element's contents have been changed. untouched: This property returns true if the user has not visited the element. touched: This property returns true if the user has visited the element.

Also, what is Ng form in AngularJS? The ng-form Directive in AngularJS is used to create nested form i.e. one form inside the other form. It specifies an inherit control from HTML form. It creates control group inside a form directive which can be used to determine the validity of a sub-group of controls.

Beside above, what is dirty in angular?

ng-untouched The field has not been touched yet. ng-touched The field has been touched. ng-pristine The field has not been modified yet. ng-dirty The field has been modified. ng-valid The field content is valid.

What is $setValidity in AngularJS?

The $setValidity() function is a built-in AngularJS function that is used to assign a key/value combination that can be used to check the validity of a specific model value. The key in this case is “unique” and the value is either true or false.

27 Related Question Answers Found

What is a dirty form?

How can I check if a form is valid in Angularjs?

What is $error in Angularjs?

How do NG models work?

What is FormBuilder in angular?


What is reactive forms in angular?

What is ngModel in angular?

What is form validation?


What is directive in angular?

What is the difference between template driven and reactive forms in angular?

How do you validate a form?


How many validators are available in angular?

What is Ng required?