のようなHandlebars.jsと配列を反復処理するのは簡単です:Handlebars.jsで地図を反復処理する方法はありますか?
{{#each comments}}
<div class="comment">
<h2>{{title}}</h2>
{{{{url}}}
</div>
{{/each}}
などのアレイ:
{
comments: [
{ url: "http://www.yehudakatz.com", title: "Katz Got Your Tongue" },
{ url: "http://www.sproutcore.com/block", title: "SproutCore Blog" },
]
}
しかし、私のようなマップを反復処理する方法が見つからない:
をHandlebars.jsを使用して地図を反復する方法はありますか?それとも私のようなオブジェクトをrestructurateする必要があります。
{
headers: [
{ key: "Host", value: "www.example.com" },
{ key: "Location", value: "http://www.example.com" },
]
}
[Handlebars/Mustacheの重複可能性 - オブジェクトのプロパティをループする方法がありますか?](http://stackoverflow.com/questions/9058774/handlebars-mustache-is-there-a -built-in-way-to-the-properties-of) – Jon
今後の訪問者:Handlebarsにマップを反復するための組み込みサポートが追加されました。リンクされた質問には詳細があります。 – Jon