Collection use - how it's work


Hi, i have problem with collection.
I have two files .js and html view template:


    <div id='id'></div>



 CalendarViewController = CustomController.extend({
    controller: 'CalendarViewController',
    template: 'calendar.view',
    menu: 'menu-calendar',
    onRender: function() {



    helpers: {

    events: {

    autoFormHooks: {



CalendarHelper = {
  console.log (HolidaysCollection.findOne());
    return false;


When i call CalendarHelper.test from secound js file in first js file it doesnt work, it cant find enything and in web console i get “undefined”. But when i write event in first js file

 events: {
    'click': function(){

Then it works!
I dont understand it!
Could someone say me why it happens?


You can indicate where is the folder your code is located at?


It looks like CalendarHelper.test(); is being called before the subscription is complete.

try this

Meteor.subscribe("AllHolidays", function(){


}); // it will call when the subscription is ready

note - this may not be the case because your question was quite hard to follow. Also I’m not sure if the subscription and the collection are related, I’m assuming that they are but the naming strategy doesn’t make that clear.