流星では、次のようなさまざまなテンプレートヘルパーを設定できます。
Template.story.title = function () {
return "title";
};
<template name="story">
<h3>{{title}}</h3>
<p>{{description}}</p>
</template>
これは素晴らしいことですが、変数がたくさんある場合は、それらを個別に設定したくない場合は、コンテキストをメインテンプレートに渡します。
それ、どうやったら出来るの?
Template.story.data = function () {
return {title:"title", description:"desc"};
};
<template name="story">
<h3>{{title}}</h3>
<p>{{description}}</p>
</template>
それはうまくいきません。ありがとう