In some cases, when I update an Angular2 Form control, I don’t want to fire the valueChanges event (for example, because the change happens reactively from my database and should not trigger the database write to avoid an infinite loop).
This works great with standard FormControls, using the "emitEvent" property like this:
this.form.formGroup.controls[name].setValue(value, {emitEvent: false});
Now I have a case where I want to use this "function" in a custom FormControl that I created using "ControlValueAccessor" using the registerOnChange()and methods writeValue().
But I do not know how to access the emitEvent property, since this is not an input parameter in writeValue()
Is there any way to achieve this? Thank!
source
share