javascript - How to use #each in an array of arrays in Ember.js? -
javascript - How to use #each in an array of arrays in Ember.js? -
in ember.js documentation, shows how show array of objects using #each this:
suppose have array of objects:
var arr1 = [ {name: 'name 1', color: 'red'}, {name: 'name 2', color: 'yellow'}, {name: 'name 3', color: 'green'}, ]; you utilize show names:
{{#each arr1}} {{name}} {{/each}} but, have array of arrays this:
var arr2 = [ ["name 1", "red"], ["name 2", "yellow"], ["name 3", "green"], ]; the question is: how utilize #each show value of index 0 of variable arr2?
just utilize {{#each}} within {{#each}}:
http://emberjs.jsbin.com/vajolene/2/edit
{{#each this}} {{#each this}} {{this}} {{/each}} {{/each}} javascript arrays ember.js
Comments
Post a Comment