I am trying to pass in the categoryId from the iron router data into the template helper in meteor.
This is my router code:
Router.route('/lessons/:categoryId', function() {
this.subscribe('lessons');
this.render('Lessons', {
data: {
categoryId: this.params.categoryId
}
});
This is my template code:
Template.Lessons.helpers({
lessons: function () {
console.log('CategoryId: '+categoryId);
}
});
How can I correctly access the categoryId that was created in iron router?
Thanks so much for any help.