1

从 Meteor 1.1* 开始,使用原始Meteor在模板之间传递数据的最佳模式实践是什么?

流星论坛的链接问同样的问题。

4

1 回答 1

0

Some different possibilities:

With block:

{{#with post}}
    {{> postTemplate}}
{{/with}}

Passing arguments:

{{> postTemplate post=post anotherArg=5 moreData="xyz"}}

If you also want to use iron-router (and basically all projects should), you can use "data" to return the data context for the page you're loading.

Also, note that child templates inherent parent data contexts. (They don't inherent helpers though).

于 2015-04-14T07:12:57.520 回答