【发布时间】:2013-11-22 01:46:10
【问题描述】:
我想学习如何在客户端更新模板中的单个项目。如果可能,请提供 Session 和 MongoDB 的示例。
我最简单的模板文件:
<template name="teste">
<input type="button" value="Set one item" class="setitem" /><br><br>
{{item1}}
</template>
在我的 JS 文件中,我有:
if (Meteor.isClient) {
Template.teste.events({
'click .setitem' : function () {
// What I put here to update the {{item1}}:
// 1. Not Reactive (only on client)
// 2. Reactive with Session
// 3. Reactive with MongoDB
}
});
}
谢谢。
【问题讨论】:
标签: meteor handlebars.js