次のようにループ内でオブジェクトを渡したいと思います。
データ構造:
things = [
{
title: 'foo'
, description: 'bar'
}
, {
title: 'baz'
, description: 'bam'
}
];
index.jade:
- for thing in things
include things-template
上記の形式で、そのインクルードの「ローカル」として何らかのパラメーターを指定できるようにしたいと考えています。
もの-template.jade:
li
h3 #{title}
p #{description}
これは可能ですか、それとも別の変数に割り当てて「thing-template」内で参照する必要がありますか?