In a spacebars template, I have a javascript array x and an index into it i, eg.
Template.test.helpers({
'foo': function() {
return {
x: ['aa','bb','cc'],
i: 1
}
}
});
I can access fixed elements of x in the template with {{ x.[1] }}:
{{template name="test"}}
{{#with foo}}
{{x.[1]}}
{{/with}}
{{/template}}
But {{ x.[i] }} doesn't work.
How can I access x[i]? Thanks!