When working with handlebars.js, I am faced with the task of parsing complex JSON and displaying names in different styles based on certain conditions. The JSON structure is as follows:
"TradeLine":{
"TradeLine":{
"Mortgage Accounts":[
{
"SubscriberDisplayName":"SAVINGS AND LOAN COMPA",
"Evaluation":"N",
"EvaluationDesc":"Closer review is required",
"KOB":"Savings And Loan Companies",
"RevolvingOrInstallment":"I",
"RevolvingOrInstallmentDesc":"Installment",
"OpenOrClosed":"C",
"OpenOrClosedDesc":"Closed",
"Status":"05"
}
]
}
}
I have found some helpful resources that I followed:
Second referred Link
My goal is to add an asterisk next to the display name and color it red if the Evaluation is "N" (Negative), otherwise display it as it is. Here is a snippet of my HTML code:
<thead class="thead-default">
<tr>
{{#if '"Evaluation" == "N"'}}
<th colspan="4" scope="colgroup"> {{SubscriberDisplayName}} * </th>
{{elseif '"Evaluation" == "P"'}}
<th colspan="4" scope="colgroup"> {{SubscriberDisplayName}}</th>
{{/if}}
</tr>
</thead>
Any insight or advice on how to achieve this would be greatly appreciated. Thank you!