How to use Meteor methods inside of a template helper
There is now a new way to do this (Meteor 0.9.3.1) which doesn’t pollute the Session namespace Template.helloWorld.helpers({ txt: function () { return Template.instance().myAsyncValue.get(); } }); Template.helloWorld.created = function (){ var self = this; self.myAsyncValue = new ReactiveVar(“Waiting for response from server…”); Meteor.call(‘getAsyncValue’, function (err, asyncValue) { if (err) console.log(err); else self.myAsyncValue.set(asyncValue); }); } In … Read more