1<div *ngFor="let item of testObject | keyvalue">
2 Key: <b>{{item.key}}</b> and Value: <b>{{item.value}}</b>
3</div>
1// In your ts file
2Object = Object;
3
4// then in the template:
5
6<div *ngFor="let key of Object.keys(objs)">
7 my key: {{key}}
8 my object {{objs[key] | json}} <!-- hier I could use ngFor again with Object.keys(objs[key]) -->
9</div>
10
1@Component({
2 selector: 'app-myview',
3 template: `<div *ngFor="let key of objectKeys(items)">{{key + ' : ' + items[key]}}</div>`
4})
5
6export class MyComponent {
7 objectKeys = Object.keys;
8 items = { keyOne: 'value 1', keyTwo: 'value 2', keyThree: 'value 3' };
9 constructor(){}
10}