Angular2 - How to set `touched` property on form to true
There's a pretty straightforward method to do this: markAsTouched
. It should be enough to use it on the form group.
this.addressForm.markAsTouched()
In case you want for some reason to mark all controls manually, they itself have this method available.
markAsTouched
is a method of the AbstractControl
all form elements inherit from. Out of curiosity, you might want to visit the @angular/forms/src/model.d.ts
declaration file to find some more interesting methods of the form objects. Or just visit the documentation.