Я пытался использовать ReactiveVar. Я не знаю, как обращаться с ReactiveVar. Вот код, который я пробовал.
Template.Home.helpers({
names: function(){
temp = Template.instance().name.get();
return temp;
}
});
Template.Home.onCreated(function () {
this.name = new ReactiveVar();
Meteor.call("getNames", function(error, result) {
if(error){
alert("Oops!!! Something went wrong!");
return;
} else {
this.name.set(result); // TypeError: Cannot call method 'set' of undefined
return;
}
});
});
Правильно ли я установил и получил ReactiveVar? или Как установить и получить ReactiveVar??