Uncaught ReferenceError: onInputChange is not defined at HTMLInputElement.onchange
I am looking at the code...,my lord the function exists. And yet I get the above? WOW..why? I just want to fire an event if html changes in input
<input mdInput [formControlName]="i" onchange="onInputChange()"
onInputChange(){
console.log('DUDE');
}
Binding to the event
<input mdInput [formControlName]="i" (change)="onInputChange()"
Try this:
<input mdInput [formControlName]="i" (change)="onInputChange()"
onInputChange(){
console.log('DUDE');
}
Also, as its seems you are using model driven form, you can also do that :
this.yourForm.get('i').valueChanges
.subscribe(data => {
console.log(data);
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With