wycats/handlebars.js — pull request #272 by rosshadden (2012-07-05 13:54:32+00:00)
Title: {{#each}} now supports objects.

At the jQuery conference a few days ago, you and I discussed adding a for-in loop to base.js to support loops over objects. After giving it some thought, I decided it would be a better idea to just extend the existing {{#each}} helper.

Given the template:

```html
{{#each colors}}

{{_key}}

{{short}}

{{long}}

{{/each}}
```

and the data object:

```javascript
{
colors: {
red: {
short: 'f00',
long: 'ff0000'
},
blue: {
short: '00f',
long: '0000ff'
},
green: {
short: '0f0',
long: '00ff00'
}
}
}
```

The following will be rendered:

```html

red

f00

ff0000

blue

00f

0000ff

green

0f0

00ff00

```

*Note: We had decided to use '@key' for the magic key reference, and I still want this to be the case. However, for now it is '_key' because I could not figure out the former.

Please let me know what you think.