BorisMoore/jsrender — Issue #49: Looping trough Key-value pairs
Author: stevenhabex
Created: 2011-12-16 13:31:52+00:00
State: open

I have an object like this:

"GoodStuff": {
1: "Chimay",
2: "Orval"
3: "Westmalle"
}

I would expect that if I say ...
{{#each GoodStuff}}

Beer {{=$itemNumber}}

{{/each}}
... it shows me 3 items, but it only shows 1 single item.

I created a workaround by changing the object to
"GoodStuff": [
{
"Key": 1,
"Value": "Chimay"
},
{
"Key": 2,
"Value": "Orval"
},
{
"Key": 3,
"Value": "Westmalle"
}
]

Thanks for your work, really love working with the project!