This might seem a silly question but I can't seem to find the answer anywhere.
I'm hitting this Web API that returns an array of objects in JSON format:
Handlebars docs shows the following example:
<ul class="people_list">
{{#each people}}
<li>{{this}}</li>
{{/each}}
</ul>
In the context of:
{
people: [
"Yehuda Katz",
"Alan Johnson",
"Charles Jolley"
]
}
In my case I don't have a name for the array, it's just the root object of the response. I've tried using {{#each}}
with no luck.
First time using Handlebars... What am I missing?
UPDATE
Here's a simplified fiddle to show you what I'm asking: http://jsfiddle.net/KPCh4/2/
Does handlebars require the context variable to be an object and not an array?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…