Meteor Handlebars: How to access a plain array?

China☆狼群 提交于 2019-12-17 18:17:23

问题


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

How can I show all elements in Meteor Handlebars?

{{#each plain_array}}

# What to put here to get the elements?

{{/each}}

(This question is similar: handlebars: how to access an array? but not the same as the other question presumes an array of objects.)


回答1:


From Handlebars documentation.

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


来源:https://stackoverflow.com/questions/21234947/meteor-handlebars-how-to-access-a-plain-array

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!