Iterate a Json Object with ngFor
You can get the keys from an object using Object.keys
(requires polyfill in IE AFAIK)
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({ name: 'keys' })
export class KeysPipe implements PipeTransform {
transform(value): any {
if(!value) return null;
return Object.keys(value);
}
}
<div *ngFor="let key of member | keys">{{member[key]}}</div>
For Angular 6 see How to iterate object keys using *ngFor