I am trying to understand the intricasies of implementing custom Angular controls for forms. Implementation of CustomValueAccessor should register callback for the change in state in "touched" by means of implementing registerOnTouched calllback. It's pretty clear that "touched" should be set when user interacts with the control. However, I am wondering when the state of touched should be reset to "false".
registerOnTouched(onTouched: any) {
this.onTouched = onTouched;
}
markAsTouched() {
if (!this.touched) {
this.onTouched();
this.touched = true; // When would I set "touched to false?
}