Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

371
Vistas
Unable to push data to mat-table which is in FormArray and that form is in loop So I have multiple forms each form has one mat-table

when I tried to push data to form its not updating to that form Array ,its always updating in first form 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: [[]]
    })
  }
}

template

 <table mat-table #matTable [dataSource]="this.assetsAndGiftsForm.value.borrowers[borrowerIndex].reo">

after adding data to form I tries to push data to Mat-table but its updating in first table only

     @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();
  }
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda