最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - JSON array into handlebar - Stack Overflow

programmeradmin0浏览0评论

i have a json object as

[ "id", "birthday", "panymsgsthisperiod", "panythisperiodend", "cust_attr_boolean", "subscribed", "testgroup", "usermsgsthisperiod", "userthisperiodend" ]

now i would like to add this type of json object using handlebar into a file as

<div>/*json*/</div>

Can anyone help me to get through it?

i have a json object as

[ "id", "birthday", "panymsgsthisperiod", "panythisperiodend", "cust_attr_boolean", "subscribed", "testgroup", "usermsgsthisperiod", "userthisperiodend" ]

now i would like to add this type of json object using handlebar into a file as

<div>/*json*/</div>

Can anyone help me to get through it?

Share Improve this question asked Feb 21, 2013 at 11:01 jerin johnjerin john 1991 gold badge4 silver badges11 bronze badges 1
  • 1 That's just a plain JS array of strings. Not JSON. – techfoobar Commented Feb 21, 2013 at 11:03
Add a ment  | 

2 Answers 2

Reset to default 7

What you have there is an array. I guess from the documentation that you can use the each block helper

<div>
  {{#each dataArray}}
  <div>{{this}}</div>
  {{/each}}
</div>

Finally it may satisfy your need.

发布评论

评论列表(0)

  1. 暂无评论