wycats/handlebars.js — Issue #158: Using array index twice, breaks the template
Author: zvikico
Created: 2011-12-27 09:11:38+00:00
State: open

The following will work:

var source = "{{arr.[0]}}";
var template = Handlebars.compile(source);
template({ "arr": [1,2] });

Yielding the expected result: 1

However, adding reference to the second element in the following way:

var source = "{{arr.[0]}}{{arr.[1]}}";
var template = Handlebars.compile(source);
template({ "arr": [1,2] });

Will return an empty result.