I'm using reactive form in my Angular App, i have to format the selected value and patch it's new value to that form control.
I was trying to simply subscribe control to value change and patch new value but i get error:
Maximum call stack size exceeded
How can i format selected value of a Reactive Form control?
Here is my code:
this.ritiroForm.controls.quando.valueChanges.subscribe(() => {
const data = new Date(this.selectedOra).toLocaleString();
this.ritiroForm.get('quando').patchValue(data);
});