Your text has been written
<!--REMOVE [(ngModel)]-->
<input type="text" formControlName="address" [(ngModel)]="value" />
To remove the[(ngModel)], it is advised not to use it in the same tag as formControlName. By using [(ngModel)], you are assigning two values to the input field, which does not make sense.
Additionally, remember to use formControlName for your first two inputs (instead of formControl).
<input type="" formControl="name" />
<input type="" formControl="lastname" />
It appears that your question title mentions Mat-dialog, but there is no mention or implementation of Mat-dialog in your StackBlitz project. Please provide more information or consider changing the question title accordingly.
Update Modify your openAlertDialog function as follows:
openAlertDialog(index:number) {
const dialogRef = this.dialog.open(AlertDialogComponent, {});
dialogRef.afterClosed().subscribe((result) => {
this.fg.get('Info.'+index+'.address').setValue(result)
});
}
Take note of how the setValue method is used to assign a value to a FormControl and how the get method is utilized to access the formControl.
You can also access the element in a similar way:
((this.fg.get('Info') as FormArray)
.at(index) as FormGroup)
.get('address')
However, to avoid casting, simply utilize the "dot" notation with get.
Update 2 The 'result' can also be an object as shown in the example below:
this.dialogRef.close({address:row.symbol,phone:row.name});
In such cases, objects can be passed similarly to FormArrays. You can then use setValue or patchValue to update the element in the formArray, like so:
this.fg.get('Info.'+index).setValue(result)
//or
(this.fg.get('Info') as FormArray).at(index).setValue(result)