Ejemplo 1: objeto ngfor
<div *ngFor="let item of testObject | keyvalue">
Key: <b>{{item.key}}</b> and Value: <b>{{item.value}}</b>
</div>
Ejemplo 2: iterar objeto ngfor
// In your ts file
Object = Object;
// then in the template:
<div *ngFor="let key of Object.keys(objs)">
my key: {{key}}
my object {{objs[key] | json}} <!-- hier I could use ngFor again with Object.keys(objs[key]) -->
</div>
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)