[Solved] Angular 2 *ngFor does not print to table , I am getting my information from a GET HTTP call and it works

you can use async pipe, you dont have to subscribe to your Observable, component.ts: export class FormationsComponent { formations: Observable<Formation[]>; constructor(private formationService: FormationService){}; ngOnInit() { this.formations = this.formationService.getFormations(); } } and in your html file <tr *ngFor=”let formation of formations | async” > 0 solved Angular 2 *ngFor does not print to table , I … Read more

[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