I've been searching for a solution on this but can't find what I'm looking for. I have this form and as soon as any field gets touched I want to console out a message in ngOnInit. So far if I enter a value in any field I can show a message ("You entered a value"), but I want to be able to show a message when user touches the field. Can anyone point me in the right direction? Here's my code.
LIVE DEMO Thanks a lot in advance!
ngOnInit() {
this.myForm.valueChanges.subscribe(res => {
console.log("You entered a value");
// Here I want to show a message ("A field has been touched") when any field of the form gets touched
})
}