cuando traté de enviar datos para formar, no se actualiza a ese formulario Array, siempre se actualiza en el primer formulario Array,
export class Sample { assetsAndGiftsForm: FormGroup; constructor(private _fb: FormBuilder) { } public initAssetsForm() { this.assetsAndGiftsForm = this._fb.group({ borrowers: this._fb.array([this.sample()]), }) } public sample() { let reo:ReoDto[]=[] return this._fb.group({ assets: this._fb.array([]), gifts: this._fb.array([]), reo: [[]] }) } }modelo
<table mat-table #matTable [dataSource]="this.assetsAndGiftsForm.value.borrowers[borrowerIndex].reo">después de agregar datos al formulario, intento enviar datos a Mat-table, pero solo se actualiza en la primera tabla
@ViewChild(MatTable) matTable: MatTable<any>; onSaveReo() { let control = this.getBorrowerControl.at(this.curreentBorrowerIndex.value).get('reo') as FormArray; control.value.push(this.reoForm.value); this.matTable.dataSource = this.getBorrowerControl.at(this.curreentBorrowerIndex.value).get('reo').value; // @error :: after adding new 'reo' into any one of borrowers, its pushing to only first table , //datasurce is not varying this.assetsAndGiftsForm.updateValueAndValidity() this.matTable.renderRows(); this.addPropertyPopupClose(); }