How do I activate an Iron Router route without changing the path?

旧巷老猫 提交于 2019-12-08 21:00:30

First, you're probably seeing some issues because the latest version of Iron Router requires you to be on Meteor v0.8.0. If you're on a previous version of Meteor you'll need to use the older Iron Router (0.6).

To customize rendering inside of your ThreadsController you can just override the action function, or you can define a hook. Then, you can call the render method to render whichever templates you'd like. Here is an example:

ThreadsController = RouteController.extend({
  action: function () {
    // Example 1. render this controller's default template and all yields
    this.render();

    // Example 2. render myTemplate into the main yield
    this.render('myTemplate');

    // Example 3. render templates into yield regions
    this.render('myFooter', {to: 'footer'});
  }
}); 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!