title: Meteor Template onRendered callback not called
body: <p>I am trying to use chartist.js with my meteor application. I placed the code for it in <code>Template.reportPage.onRendered()</code> so that it generate a bar chart after the template DOM have been inserted. I tried putting an alert in and see that it's never called. I also have a helper define in <code>Template.reportPage.helpers</code> and it runs fine.</p>
  
  <p>I'm getting the error:</p>
  
  <pre><code>[Error] TypeError: undefined is not a function (evaluating 'Template.reportPage.onRendered')
      (anonymous function) 
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>Template.reportPage.onRendered(function(){
      var data = {};
      var orders = Orders.find({
          created_at: {
              //query for month 3
              $gt: new Date(2015, 2, 0),
              $lte: new Date(2015, 3, 0)
          }
      }, {sort: {created_at: 1}} ).fetch(); //ascending
  
      data.series = [[]];
  
      var noOfDays = new Date(2015,3,0).getDate()
  
      data.labels = _(noOfDays).times( function(n) {
          data.series[0][n] = 0;
          return n+1;
      });
  
      orders.forEach(function(order, index, array){
          var date = order.created_at.getDate();
          data.series[0][date-1]++;
      });
      console.log(data);
      alert('comon');
      new Chartist.Bar('#orderVsTime', data); //put chart in element with #orderVsTime
  
   });
  </code></pre>