I have a formbuilder group and am listening for changes with valueChanges and triggering a save function followed by refresh function on the form:
this.ticketForm.valueChanges.debounceTime(1000).distinctUntilChanged()
.subscribe(data => {
this.saveTicket();
this.refreshTicket();
})
I am then reloading the form and repatching the data to form fields (and elsewhere on the page, particularly a change log) with patchValue, e.g.:
this.ticketForm.patchValue(ticket, { emitEvent: false });
however, this causes an infinite loop of saves of the form despite emitEvent : false.
Is this an Angular 4/Ionic 3 bug or a misunderstanding on my part?
{ emitEvent: false }
? – SatellitepatchValue
shouldn't trigger value changes on the form even withoutemitEvent: false
– SatellitepatchValue
– AtchisonpatchValue(value, {emitEvent: false})
– DesexngModelChange
event is still firing. – Vair