I have a subscript/publication set up for a Videos Collection (pretty much a list of video information) and a Specs Collection (a list of informa
I saw in my projects that, when subscribing/calling something on meteor, sometimes it run next code lines without having received previews server answer, and it bring some problems like yours. So, I usually nest what should be done inside the subscribe/call function, then it is run only after data is returned.
I would do something like this:
Template.List.events({
'change #categories':function(evt){
Meteor.subscribe("videos-pub-sub", $(evt.target).val(), function(){
//to empty the table
$('#video_table').find('tbody').empty();
var vids = Videos.find({}).fetch();
Session.set("videos-session", Videos.find({}).fetch());
});
}
});
Let me know if it works!