Meteor Handlebars:如何访问普通阵列?

时间:2014-01-20 13:06:37

标签: javascript meteor handlebars.js

var plain_array = [1, 2, 3, 4, 5, 6, 7]

如何显示Meteor Handlebars中的所有元素?

{{#each plain_array}}

# What to put here to get the elements?

{{/each}}

(这个问题类似:handlebars: how to access an array?但与另一个问题的假设是一组对象不一样。)

1 个答案:

答案 0 :(得分:30)

来自Handlebars documentation

{{#each people}}
  <li>{{this}}</li>
{{/each}}