這從待辦事項列表教程片段之間的通信。變量checked
表示在客戶端和服務器端?客戶端和服務器如何通信以使checked
一致?流星,客戶端和服務器
Template.task.events({
'click .toggle-checked'() {
// Set the checked property to the opposite of its current value
Tasks.update(this._id, {
$set: { checked: ! this.checked },
});
},
'click .delete'() {
Tasks.remove(this._id);
},
});