title: Uncaught ReferenceError: Collection is not defined
body: <p>I am doing a meteor application. I have the collection variable defined in the main.js file inside the client folder. There is also templates.js file in the same location. The Template.myTemplate.rendered = function() {}; is defined inside the templates.js file. I can access the collection variable inside the rendered section, but it is not available outside it. </p>
  
  <p>How can it be made possible to access the collection variable outside the 'rendered' section ?</p>
  
  <p>Inside main.js</p>
  
  <pre><code>collectionVariable = new Meteor.Collection('collection_name');
  </code></pre>
  
  <p>Inside templates.js</p>
  
  <pre><code>console.log(collectionVariable); // getting "Uncaught ReferenceError: collectionVariable is not defined" here.
  
  Template.myTemplate.rendered = function() {
  
    //Some code. Can access the variable here.
  
  };
  </code></pre>
  
  <p>Thanks</p>