admin管理员组

文章数量:1419226

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.

本文标签: javascriptJSON array into handlebarStack Overflow