I currently have a formbuilder group where I am monitoring changes using valueChanges. Whenever a change is detected, I trigger a save function and then refresh the form:
this.ticketForm.valueChanges.debounceTime(1000).distinctUntilChanged()
.subscribe(data => {
this.saveTicket();
this.refreshTicket();
})
Afterwards, I reload the form and update the data in various form fields (as well as other areas on the page such as a change log) using patchValue method, like this:
this.ticketForm.patchValue(ticket, { emitEvent: false });
However, despite setting emitEvent to false, it seems to be causing an endless loop of saving the form. Is this issue related to Angular 4 or Ionic 3, or could it be due to my misunderstanding of how the process works?