1<div *ngFor="let item of testObject | keyvalue">
2 Key: <b>{{item.key}}</b> and Value: <b>{{item.value}}</b>
3</div>
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}