1

I am using Reactive Forms in Angular. I want to do an operation when any form input is touched in a formGroup. As touched property of formGroup cannot be observed, how can I achieve a similar result?

I am currently watching for valueChanges but it does not trigger when a touch event occurs.

public ngAfterViewInit(): void {
  this.accountForm.valueChanges.subscribe(() => {
    this.displayMessage = this.genericValidator.processMessages(this.accountForm);
  });
}
Ajay Kumar
  • 1,154
  • 2
  • 10
  • 24

0 Answers0