什么是铁:路由器1.0相当于this.setLayout()和this.lookupLayoutTemplate()?

时间:2014-11-14 04:30:40

标签: meteor iron-router

调用this.setLayout()this.lookupLayoutTemplate(),例如在此示例中:

https://github.com/EventedMind/iron-router/issues/655

给出:

Exception in callback of async function: TypeError: undefined is not a function

1 个答案:

答案 0 :(得分:2)

  • this.setLayout现在是this.layout()
  • this.lookupLayoutTemplate现在是Router.lookupLayoutTemplate

另请注意,onBeforeAction现在有三个参数:

Router.onBeforeAction(function(req, res, next) {  

  next(); // or this.next(); 
          // still the same as pause().. 
          // you MUST call next so the route renders.
});