我有:
Template.myTemplate.helpers({
reactiveVar: new ReactiveVar
});
我该如何在onCreated中访问
reactiveVar
以设置它?Template.restaurantEdit.onCreated(function() {
// Access helpers.reactiveVar from here to set up
// My goal is to set up data to reactiveVar, ex:
helpers.reactiveVar = this.data.someData;
});
我发现有一个受保护的__helpers:
this.view.template.__helpers
但是有没有Meteor可以访问helpers的好方法?或者从加载的data
设置reactiveVar的Meteor方式是什么?
Template.currentData()
(当然要在autorun中使用)。+1 - Rijk