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

142
Vistas
how to send property as a array to backend spring boot in angular

I have the following method with which I am trying to send to my backend some values as a list. the accepted json format is as follows:

{
value: [xyz]
}

But right now I am sending just the xyz part to my backend as a single value but I need to send it as the shown part. mine looks like this: xyz according to the payload sent to the backend in network in my console.

this is my function I am using to send these to my backend:

 setValueForTest() {
    this.personArray = this.form.controls.selectBox.value;
    this.personArraySave = []
    this.personArray.forEach((id) => {
        this.personArraySave.push(id)
        this.api.setValueForPerson({
          body: id
        
        ).subscribe(response => {
          console.log(response)
        });
      }
    });
  } 

the body and personArraySave is from type Person which only has id: Array as attribute

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

0

Thanks for everyone who helped, the problem is fixed I just instanced an Element of the Object I am sending. Then I could work with the array element inside that model and push my values inside it.

about 4 years ago · Juan Pablo Isaza Denunciar

0

I imagine api.setValueForPerson is a service that sends the data, if yes, maybe you can send the data something like this

setValueForPerson(person:Person):Observable<any>{
   return this.httpCLient.post<any>(yourURL, {value:person});
}
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