Skip to content

Instantly share code, notes, and snippets.

@roman-bgonz
Last active February 11, 2023 00:09
Show Gist options
  • Save roman-bgonz/95ba47ee7046712b8a3ad55a8a25d5db to your computer and use it in GitHub Desktop.
Save roman-bgonz/95ba47ee7046712b8a3ad55a8a25d5db to your computer and use it in GitHub Desktop.
Creates a table with nested list angular
<table id="customers">
<tr>
<th>Nombre</th>
<th>Tipo Fechs</th>
<th>Fecha</th>
<th>Enviar correo?</th>
</tr>
<ng-container *ngFor="let empleado of empleados">
<tr *ngFor="let field of empleado.aniversarios">
<td class="field">
{{ empleado.nombre }}
</td>
<td class="field">
{{ field.idTipoFecha === 1 ? "Aniversario laboral" : "Cumpleaños" }}
</td>
<td class="field">{{ field.fecha }}</td>
<td class="field">
<input type="checkbox" />
</td>
</tr>
</ng-container>
</table>
@roman-bgonz
Copy link
Author

Dado un arreglo de objetos que dentro tiene otro arreglo, se crea una tabla repitiendo los valores del primer nivel y usando los valores del segundo nivel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment