I managed to create an helper that returns the data of a Collection once it's published from the server.
However I don't manage to retrieve the data by using Meteor.call (i.e. Collection server-side).
This is my code:
client/template.html
<template name="showScannedData">
<!- .... more code -->
{{myUserNetId}}
</template>
client/helpers.js (the one that works)
Template.showScannedData.helpers({
'myUserNetId': function(){
return Individuals.findOne().netId; // WORKS
}
});
client/helpers.js (the one that does not work, i.e. blank output)
Template.showScannedData.helpers({
return Meteor.call('getmyUserNetId', function(err,res){
return res;
});
}
});
server/db_methods.js
Meteor.methods({
getmyUserNetId: function(){
return Individuals.findOne({}).netId;
}
})