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

73
Vistas
ng-repeat matriz anidada de objeto en la misma fila

Estoy tratando de vincular los datos en la misma fila en una matriz anidada.

Mi matriz de objetos

 $scope.Record = [ { Name:'Adam', Months:[ {Month: 'Jan', Value: 10, cust:2}, {Month: 'Feb', Value: 30, cust:2} {Month: 'March', Value: 30, cust:2} {Month: 'April', Value: 50 , cust:2} {Month: 'June', Value: 15 , cust:2} ] }, { Name:'John', Months:[ {Month: 'Jan', Value: 10 , cust:3}, {Month: 'Feb', Value: 30,, cust:6} {Month: 'March', Value: 30,, cust:8} {Month: 'April', Value: 50,, cust:13} {Month: 'June', Value: 15,, cust:20} ] } ]

mi vista

 <tr> <th colspan="1">Customer</th> <th colspan="2">January</th> <th colspan="2">February</th> <th colspan="2">March</th> <th colspan="2">April</th> <th colspan="2">May</th> <th colspan="2">June</th> </tr> <tr> <th>Name</th> <th>Value</th> <th>Cust</th> </tr> <tbody> <tr ng-repeat="rc in Record"> <td ng-bind="rc.Name"></td> <td ng-bind="rc.Months[0].Value"></td> <td ng-bind="rc.Months[0].cust"></td> </tr> </tbody>

Cómo vincular toda la matriz de Meses de Objeto en la misma fila. Estoy intentando todas las cosas pero no tengo suerte.

Gracias

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

0

Actualicé su código y proporcioné un ejemplo de trabajo aquí: https://jsfiddle.net/galeroy/z97u230v/25/

Aquí está el truco para implementar repeticiones anidadas en AngularJS

 <tbody ng-repeat="rc in records"> <tr> <td>{{rc.name}}</td> <td colspan="2" ng-repeat="item in rc.months"> <span ng-if="item.value">val: </span> {{item.value}} <span ng-if="item.value && item.cust">, </span> <span ng-if="item.cust">cust:</span> {{item.cust}} </td> </tr> </tbody>
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