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:
{{key}}: {{c[key]}}
讨论(0)
- 热议问题