Tuesday, 21 September 2021

Angular FormGroup prevent setValue() of a form field trigger event for valueChanges

 https://stackoverflow.com/questions/58432849/prevent-value-changes-to-trigger-in-autocomplete-setvalue

You can try this option, when sets the value to the control. The setValue method has a second parameter by which we can control whether we should emit event or not.

 this.providerSchoolSearchCtrl.setValue(event.option['school.name'], {emitEvent: false});

No comments:

Post a Comment