I have this code
/* Template Helpers Start */
Template.ParticipationList.helpers({
getAllParticipants: function(){
var activityid = this._id;
Meteor.call('participation.findParticipants', activityid, function(error, result){
if(error){
console.log(error)
}
return result;
});
}
});
If I am placing the array and the return keyword outside the meteor call, all things are fine - it binds the names to the template. BUT when is the above, nothing binds to the template. I think that it has something to do with async... But what am I doing wrong.
UPDATE
<ul>
{{#each getAllParticipants}}
{{name}}
{{/each}}
</ul>