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

316
Vistas
Angular 2, split data from Json

Hi I have a json from http request, the server json response is this:

{
  "map": {
    "03/04": 13,
    "05/04": 41,
    "06/04": 1,
    "12/04": 4,
    "14/04": 7,
    "18/04": 8,
    "19/04": 2,
    "22/04": 1,
    "25/04": 4
  },
  "links": []
}

I want to split dates in 1 array and values in other array, At the end I want : Data[03/04,05/04,06/04....] and Val[13,41,1....] is it possible without difficult implementation?

over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

This could be an approach:

   private Data = [];
   private Val = [];
   for (let key in data) {
      this.Data.push(key);
      this.Val.push(data[key])
   }
over 4 years ago · Santiago Trujillo Denunciar

0

you can use this

  var a=`{
          "map": {
            "03/04": 13,
            "05/04": 41,
            "06/04": 1,
            "12/04": 4,
            "14/04": 7,
            "18/04": 8,
            "19/04": 2,
            "22/04": 1,
            "25/04": 4
          },
          "links": []
        }`

        var Data=[];
        var val=[]
        for(each in a.map){
            Data.push(each);
            val.push(a.map[each]);
        }
over 4 years ago · Santiago Trujillo Denunciar

0

let date = Object.keys(JsonRespond.map) // get all keys in map object
let value = [];
date.forEach((key) => {
   value.push(JsonRespond.map[key]);
})
over 4 years ago · Santiago Trujillo 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