Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

320
Views
Angular 2, datos divididos de Json

Hola, tengo una solicitud json de http, la respuesta json del servidor es esta:

 { "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": [] }

Quiero dividir fechas en 1 matriz y valores en otra matriz. Al final quiero: Data[03/04,05/04,06/04....] y Val[13,41,1.... ] ¿es posible sin una implementación difícil?

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Este podría ser un enfoque:

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

0

puedes usar esto

 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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!