Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I need to pass the key of parent loop to another array. But it is not working . Below is my code

<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 is another array

contact_settings=[
{'first':['1','2']}
{'second':['3','4']}
]

contact_settings_title=[
    {'first':FirstTitle},
    {'second':SecondTitle}
]
question from:https://stackoverflow.com/questions/65845348/how-to-pass-parent-key-to-child-in-nested-ngfor-angular

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
923 views
Welcome To Ask or Share your Answers For Others

1 Answer

<div  *ngFor="let con_settings of contact_settings | keyvalue">
 <h5 class="mt-0 task-header header-title">{{ contact_settings_title[key] }}</h5>
</div>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...