I’m fairly new to meteor’s framework and I have been stuck on this issue trying to define a ReactVar in my templates onCreated function. I’m trying to return the template instance in my templates helper but javascript is complaining about an Uncaught ReferenceError: ReactiveVar is not defined.
here what the code looks like:
Template.someDetails.onCreated(function (){
var self = this;
self.details = new ReactiveVar();
Meteor.call(‘findSomeDetails’, function (err, asyncValue) {
if (err)
console.log(err);
else
self.details.set(asyncValue);
});
});
Template.someDetails.helpers({
details: function () {
return Template.instance().self.details.get();
}
});
one thing to note is that this template is loaded within another template which I do not have a js file for. I only created a js file for the child template. Not sure if this could have something to do with it.