What do touched, dirty and pristine mean?

Angular forms · Freshers and experienced

Model answer

touched means the user has focused and left the control (blur). untouched is the opposite. dirty means the value has been changed by the user, and pristine means it has not.

Use them to decide when to show errors: showing "required" on a field before the user has touched it is annoying. A common rule is to show errors when the control is invalid and (touched or the form was submitted).

Learn this topic

Angular Tutorial: Beginner to Advanced .

Sign in to add your own answer.

More questions