wycats/handlebars.js — Issue #182: Context different for partial
Author: dethe
Created: 2012-02-17 03:39:32+00:00
State: open

Hi folks,

When I have a template, say:

{{#each updates}}

{{#if ../user}}

{{user.name}}

{{/if}}

{{text}}

{{/each}}

And it works fine, but I move the update into a partial:

[file: update.handlebars]

{{#if ../user}}

{{user.name}}

{{/if}}

{{text}}

And include the partial where the update code used to be:

{{#each updates}}
{{> update}}
{{/each}}

I get "TypeError: Cannot read property 'user' of undefined" now. Why would the context be different for a partial containing the exact same code?