0

I have a small helper which calculates an average by calling my method on the server side.

Template.replyDoc.helpers({
    averageVote : function(userId){
        var question = Template.parentData();
        Meteor.call("averageVote",question._id,userId,function(error,result){
            console.log('average: ' + result);
            return result;
        });
    }
});

then I am trying to render my helpers results in my template:

<template name="replyDoc">
    <div class="list-group-item">
        AVERAGE:{{averageVote userID}}
    </div>
</template>

average value is calculated properly as console.log works fine but i cannot see it rendered. Why is it the case and how I should solve it please?

marcinwal
  • 169
  • 10

1 Answers1

0

I managed to find the answer;meteor methods inside helper

I used simple reactive-method and it worked.

Community
  • 1
  • 1
marcinwal
  • 169
  • 10