我的客户端有以下内容:
Template.cellular.helpers({
getCells: function() {
console.log("getting cell list");
things = cellItems.find({owner: Meteor.userId(), FileId: "someId"});
console.log(things);
return things;
}
});
<template name="cellular">
<div id='cellPane'>
<div id='data'>
{{#each getCells}}
<div id="{{_id}}" >
<div class='celldesc' contenteditable="true" display="block">
{{description}}
</div>
<div class='cellval' contenteditable="true" display="block">
{{vals}}
</div>
<div class='cellformula' contenteditable="true" display="block">
{{formula}}
</div>
</div>
{{/each}}
</div>
</div>
</template>
当我插入以下内容时,它似乎不会触发显示控制台语句的帮助程序,但我看到模板的闪烁正在更新然后被删除。怎么了?我怎么能纠正它?
{owner: Meteor.userId(), FileId: "someId", description: "something", vals: "0", formula: "something else"}
答案 0 :(得分:2)
您正在添加一个包含FileId: "someId"
的文档,但您的助手正在 find()
上执行dynaFileId: "someId"
因此您刚刚插入的文档未包含在游标中