concerts: [
{
key: "field_concerts_time",
lbl: "Date"
}, {
key: ["field_concert_fromtime", "field_concert_totime"],
lbl: "Time",
concat: "to"
}, {
key: "field_concerts_agereq",
lbl: "Age Requirements"
}, {
key: "field_concerts_dresscode",
lbl: "Dress Code"
}, {
key: "field_concerts_prices",
lbl: "Prices"
}
]
descriptions: {
"field_concerts_time": [
{
"value": "2019-09-16T00:00:00",
}
],
"field_concert_totime": [
{
"value": "1:00AM"
}
],
"field_concert_fromtime": [
{
"value": "7:30PM"
}
]
}
I have an array of concerts and an object of descriptions. My goal is to extract the value for each key from the concerts array and use it to display relevant information.
<p *ngFor="let otherdetail of otherdetailsarray">
<span *ngIf="descriptions[otherdetail.key][0].value !== null">
{{otherdetail.lbl}} :</span>
<span *ngIf="descriptions[otherdetail.key][0].value !== null &&
descriptions[otherdetail.key][0].value !== undefined">
{{descriptions[otherdetail.key][0].value }}</span>
</p>
I successfully retrieved the value for the "field_concerts_time" key at the 1st index and displayed it using the mentioned tags. I aim to enhance this code to handle cases like
"key: ["field_concert_fromtime", "field_concert_totime"]"
.