Search code examples
meteoriron-router

Meteor Iron Router documentation


Where can I find more information about Meteor Iron Router. I've this one already.


Solution

  • There are two methods to get data into your template.

    First: with a helper-function

    Template.someTemplate.helpers({
      nameOfHelper: function() {
        return Collection.find();
      }
    });
    

    Second: with Iron-Router:

    `Router.route('/path', {
      action: function () {
        this.render('template', {
            data: function () {
                return Collection.findOne('someId');
            }
        });
      }
    });`