Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

272
Visualizações
How to access nested json with ng-repeat to build a table

I'd like to build a table that looks like that : table

I tried something in my dataset, but as datas are nested, I don't have any idea how I can display them with ng-repeat in my html.

Also resultsJ1,2,3 and listnqJ1,2,3 are lists so we have to be able to access the elements of the list

   
table = [
  { day: " Day1" , webservices : [
                  {ws: resultsJ1, tnq : listnqJ1 }
                  ]
  },
  { day: " Day2", webservices : [
                  {ws :resultsJ2, tnq : listnqJ2 }
                  ]
  },
  { day: " Day3" , webservices : [
    {ws :resultsJ3, tnq : listnqJ3 }
    ]
}
  ]

  $scope.listnqJ1 = tableau[0].webservices[0].tnq;
  $scope.listnqJ2 = tableau[1].webservices[0].tnq;
  $scope.listnqJ3 = tableau[2].webservices[0].tnq;



  $scope.resultsJ1 = tableau[0].webservices[0].ws;
  $scope.resultsJ2 = tableau[1].webservices[0].ws;
  $scope.resultsJ3 = tableau[2].webservices[0].ws;
    

self.tableau = tableau

I found that in my html, it works for the resultsJ1,2,3 lists but I have a huge problem displaying the results under Day 1, 2 , 3 : listnqJ1,2,3.

 <table cellpadding="20" rules="GROUPS" frame="BOX">
    <thead>
      <tr>
        <th>Web Service</th>
        <th style="width: 100px" ng-repeat="day in ctrl.tableau ">
          {{day.jour}}
        </th>
      </tr>
    </thead>
<tbody>
  <tr style="width: 100px" class="xl153" ng-repeat="ws in resultsJ1 track by $index">
    <td>{{ws}}</td>

    <td style="width: 100px" class="xl153" ng-repeat="day in ctrl.tableau" >
     
        <td
          style="width: 100px"
          class="xl153"
          ng-repeat="tnq in listnqJ1 track by $index"
        >
          {{tnq}}
        </td>
      </td>

  </tr>
  <tr  class="xl153" ng-repeat="ws in resultsJ2 track by $index">
    <td>{{ws}}</td>

</tbody>
  </table>

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda