I have a Reset button which resets the value of domain with patchValue
onReset() {
this.addModelForm.patchValue({ domain: '', emitEvent: false, onlySelf: true});
}
and this is the valueChanges method for domain :
this.addModelForm.get('domain').valueChanges.subscribe(domainId => {
console.log("value changed!")
});
It prints "value changed!" on console 2 times. I don't want to trigger the valueChanges method. emitEvent is not working.
Since you are using patchValue on FormGroup It should be like this:
Try this:
this.addModelForm.patchValue( { domain: '' },{emitEvent: false});
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