如何在嵌套 *ngFor angular 中将父键传递给子键
How to pass parent key to child in nested *ngFor angular
我需要将父循环的键传递给另一个数组。但它不起作用。下面是我的代码
<div *ngFor="let con_settings of contact_settings | keyvalue">
<h5 class="mt-0 task-header header-title">{{contact_settings_title.key}}</h5>
</div>
contact_settings_title是另一个数组
contact_settings=[
{'first':['1','2']}
{'second':['3','4']}
]
contact_settings_title=[
{'first':FirstTitle},
{'second':SecondTitle}
]
<div *ngFor="let con_settings of contact_settings | keyvalue">
<h5 class="mt-0 task-header header-title">{{ contact_settings_title[key] }}</h5>
</div>
我需要将父循环的键传递给另一个数组。但它不起作用。下面是我的代码
<div *ngFor="let con_settings of contact_settings | keyvalue">
<h5 class="mt-0 task-header header-title">{{contact_settings_title.key}}</h5>
</div>
contact_settings_title是另一个数组
contact_settings=[
{'first':['1','2']}
{'second':['3','4']}
]
contact_settings_title=[
{'first':FirstTitle},
{'second':SecondTitle}
]
<div *ngFor="let con_settings of contact_settings | keyvalue">
<h5 class="mt-0 task-header header-title">{{ contact_settings_title[key] }}</h5>
</div>