Which sample code correctly uses Meteor methods inside a template helper?
Correct Answer: 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); }); }
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More Meteor - JavaScript Web Framework MCQ Questions