Meteor.methods({
getData() {
return 'Hello, world!';
}
});
<template name="someData">
{{#if someData}}
<p>{{someData}}</p>
{{else}}
<p>Loading...</p>
{{/if}}
</template>
Template.someData.onCreated(function() {
Meteor.call('getData', function(err, res) {
Session.set('someData', res);
});
});
Template.someData.helpers({
someData: function() {
return Session.get('someData');
}
});