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

81
Views
Manillares - varios objetos

Es la primera vez que pruebo manillares. De alguna manera no puedo obtener la matriz en uno de los objetos.

Esto es lo que obtengo actualmente:

eric alan

Así es como espero que la salida sea como:

Eric 2019-01-01 Eric Escriba un Eric 2019-12-31 Eric Escriba un Alan 2020-01-01 Alan Escriba un

A continuación se muestra el código de trabajo, pero no puedo obtener la fecha y el tipo de {{list_of_date}}:

 $(function() { var source = $("#document-template").html(); var template = Handlebars.compile(source); var html = template(data); $('#DocumentResults').html(html); }); var data = [{ users: [{ name: 'Eric', list_of_date: [{ "2019-01-01": [{ "id": "1", "type": "Eric Type a", }], "2019-12-31": [{ "id": "2", "type": "Eric Type b", }] }], }, { name: 'Alan', list_of_date: [{ "2020-01-01": [{ "id": "1", "type": "Alan Type a", }] }], }] }];
 <script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <div id="DocumentResults"></div> <script id="document-template" type="text/x-handlebars-template"> <div> {{#each this}} {{#users}} {{name}} {{/users}} {{#list_of_date}} {{type}} {{/list_of_date}} {{/each}} </div> </script>

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Una posible solución sería:

 {{#each this}} {{#each users as | user |}} {{user.name}} {{#each user.list_of_date as | userDateItem |}} {{#each userDateItem as |toDisplay|}} {{@key}} {{toDisplay.[0].type}} {{/each}} {{/each}} {{/each}} {{/each}}
about 4 years ago · Juan Pablo Isaza 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!