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

154
Vistas
how to set value to form control array of objects

In a formgroup we can patch or set value to control name like the ff this.modelForm.get('data1').patchValue('sample data') , but what if the structure is an array of objects below like .

How do I set value or patch value to testData which is inside data1? . Thanks.

  "data1": [
            {
                "testData": "2022-04-01T00:00:00",
       
            }
        ]

.....
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Simply as that


myControl.setValue([...myControl.value, 'new value']);

about 4 years ago · Juan Pablo Isaza Denunciar

0

you need to access that array and append to the array, like this.

this.modelForm.get('data1').push('add data here').

this will automatically take the new data and append it in the formControl.

about 4 years ago · Juan Pablo Isaza Denunciar
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