I'm using Meteor 1.0.
I have a Template.*name*.rendered
function that makes a number of calculations. At the end of the calculations, I would like the output to make its way into a Template.*name*.helpers
so I can use it in the corresponding html page.
Here's a simplified version of the code:
Template.myTemplate.rendered = function () {
var x = Math.random();
Template.otherTemplate.helpers({
randomNum: x
});
}
When I call {{randomNum}}
in otherTemplate
, nothing happens.
I have also tried putting the Template.*name*.helpers
outside of Template.*name*.rendered
, in which case, I get the error:
Uncaught ReferenceError: x is not defined
Thoughts?