使用*ngFor访问对象的键和值
key
value
*ngFor
ng-repeat="(key, value) in demo"
<ul> <li *ngFor='#key of demo'>{{key}}</li></ul>demo = { 'key1': [{'key11':'value11'}, {'key12':'value12'}], 'key2': [{'key21':'value21'}, {'key22':'value22'}], }
key1
key2
*ngFor
相关分类