我是新来的流星,所以如果这是另一个主题的重复。道歉仍然习惯于术语。
我无法从客户端javascript将一些信息提取到模板中,我不知道这是否是因为我未正确设置名称空间。
main.html
<head>
<title>Some Title</title>
</head>
<body>
{{> navigation}}
<div class="container">
<div class="row">
<div class="col-md-3 col-xs-3">
{{> product_options}}
</div>
<div class="col-md-9 col-xs-9">
{{> products}}
</div>
</div>
</div>
{{> footer}}
</body>
products.html
<template name="products">
{{#each products}}
{{> product}}
{{/each}}
</template>
product.html
<template name="product">
{{> text}}
</template>
products.js
Template.products.helpers({
products: [
{ text: "This is task 1" },
{ text: "This is task 2" },
{ text: "This is task 3" }
]
});
我也从我的项目中删除了这些
autopublish
insecure
我不确定这是否会阻止我尝试做的事情?
任何帮助将不胜感激!!
提前致谢!
您的问题在product.html中。在空格键中,您仅用于>
表示模板。如果您将product.html更改为下面的值,则应该可以使用。您直接在空格键中引用属性,而不用>
<template name="product">
{{text}}
</template>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句