I get from a webserver the following JSON String.
[
{\"name\":\"Joe Lincoln\",\"age\":\"42\",\"grade\":\"9\",\"active\":\"1\"},
{\"name\":\"Jack Smith\",\"ag
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