自 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

请先登录再写评论。