I am trying to Get my html template to run as intended. I can't seem to figure out how to use if within handlebars.
I want to print a table with corresponding and nested data based on uniqe ID in from my json file:
Items: [
{ «Id»: «1234»,
«Title»: «Ford»
}
]
Subitems: [
{ «ItemId»: «1234»
«Cartype»: «mustang»,
},
{ «ItemId»: «1234»
«Cartype»: «transit»
}
]
<tr>
{each items}
{if item.ID == subitems.itemid}
«Add table row»
{/if}
{/each}
</tr>
Based on the json i wanted to add 2 rows hete.
Does anyone have any tip on how to fix this?
I tried to add a helper but It doesn’t seem to do the trick