I've been using {{#each}} and {{#if}} in handlebars.js to grab data from JSON files. But I need a way to get the data without any conditions. I have no need for an {{#if}} statement and there's only one set of data so I don't need {{#each}} either. Is there a way to do this? {{#each}} works but I don't want to be using that if there's a simpler method to get a single block of data.
I should note that I'm using Grunt with Handlebars and that my document calls from more than just one JSON file.
Here is my code.
{{data.PaymentMethod}}
<table>
<tr>
<td>
<div>Payment Method</div>
<div>Card Number: {{CardNumber}}</div>
<div>Card Colder: {{CardHolder}}</div>
<div><a href="{{Link}}">Tracking</a></div>
</td>
</tr>
</table>
And this is my JSON file (data.json).
{
"PaymentMethod": [
{
"CardNumber": "****",
"CardHolder": "John Doe",
"Link": "http://www.test.com"
}
]
}