|
自 2021 年 1 月起,傳統文件類型將不再可用。您可以轉換傳統檔案或下載 PDF。進一步瞭解

Handlebars - Element Reference

已回覆
0

評論

2 條評論

  • Jeff Hickey

    Hi Chad.

    You can use "../" notation to look back one level. Based on the JSON you provided, the following template produces the output you're looking for. See the template in action here.

    data_id,location_id,value
    {{#each data}}
    {{#each company.location}}
    {{../id}},{{id}},{{value}}
    {{/each}}
    {{/each}}

    For more information on Handlebars in general, I recommend the Start Here post Getting Started with Handlebars in Chains.

    1
  • Chad Weber

    Thanks Jeff

    This works!

    0

登入寫評論。