janl/mustache.js — Issue #148: nested array
Author: yyfrankyy
Created: 2011-12-19 09:10:19+00:00
State: open

check this out:

template:

{{#items}}{{name}}{{#items}}{{.}}{{/items}}{{/items}}

data:

{items: [{name: 'name', items: [1,2,3,4]}]}

seems `mustache` cannot handle nested array with the same key as his parent's. when I changed `items` inside to `item`, it worked well.

template:

{{#items}}{{name}}{{#item}}{{.}}{{/item}}{{/items}}

data:

{items: [{name: 'name', item: [1,2,3,4]}]}