这是我经历过几次的事情。我想做
{{> subtemplate item foo="bar"}}
以便subtemplate
中的数据上下文包含所有项目字段和foo
字段。在文档
https://github.com/meteor/meteor/blob/devel/packages/spacebars/README.md
我知道我可以让我自己的助手combine
像这样使用{{> subtemplate combine item "foo" "bar"}}
,但我希望有更好的方法。
答案 0 :(得分:1)
您可以使用动态模板传递数据上下文吗?
{{> Template.dynamic template=template [data=data] }}