Following is my html code,
{{c.name}}
<
-
You could create a custom pipe to return the list of key for each element.
Something like that:
@Pipe({name: 'keys'})
export class KeysPipe implements PipeTransform {
transform(value, args:string[]) : any {
let keys = [];
for (let key in value) {
keys.push(key);
}
return keys;
}
}
and use it like that:
<tr *ngFor="#c of content | async">
<td *ngFor="#key of c | keys">{{key}}: {{c[key]}}</td>
</tr>
讨论(0)
- 热议问题