[Solved] Angular 2 ngFor for nested json [duplicate]
Try this code to separate your devices into 2 groups : <div *ngFor=”let drop of config”> <ng-container *ngIf=”drop.id === ‘imu_device’; else gpsBlock”> <h1>IMU Device</h1> <ul> <li *ngFOr=”let sub1 of drop.fields”> {{sub1}}</li> </ul> </ng-container> <ng-container #gpsBlock> <h1>Gps Device</h1> <ul> <li *ngFOr=”let sub1 of drop.fields”> {{sub1}}</li> </ul> </ng-container> </div> You loop on config, and conditionnally display device … Read more