小编chr*_*els的帖子

Meteor Iron-router onBeforeAction this.next undefined

我有以下路由配置:https://gist.github.com/chriswessels/76a64c421170095eb871

尝试加载路由时出现以下错误:

Exception in defer callback: TypeError: undefined is not a function
at manageLoadingIndicator (http://localhost:3000/both/router/routes.js?ef701fada29363a443a214f97988ce96ebaec025:30:10)
at RouteController.runHooks (http://localhost:3000/packages/iron_router.js?da7f2ac81c3fd9daebf49ce9a6980a54caa1dc17:843:16)
at http://localhost:3000/packages/iron_router.js?da7f2ac81c3fd9daebf49ce9a6980a54caa1dc17:2302:14
at Tracker.Computation._compute (http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:288:36)
at new Tracker.Computation (http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:206:10)
at Object.Tracker.autorun (http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:476:11)
at http://localhost:3000/packages/iron_router.js?da7f2ac81c3fd9daebf49ce9a6980a54caa1dc17:2279:12
at Utils.extend._run.withNoStopsAllowed (http://localhost:3000/packages/iron_router.js?da7f2ac81c3fd9daebf49ce9a6980a54caa1dc17:2248:21)
at Tracker.Computation._compute (http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:288:36)
at new Tracker.Computation (http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:206:10)
Run Code Online (Sandbox Code Playgroud)

它正在讨论以下行,它位于onBeforeAction钩子中:

function manageLoadingIndicator (pause) {
  if (this.ready()) {
    Session.set('loading', false);
    this.next(); // THIS LINE HERE
  } else {
    Session.set('loading', true);
    pause();
  }
}
Run Code Online (Sandbox Code Playgroud)

为什么不this.next定义?请帮忙!

克里斯

meteor iron-router

6
推荐指数
1
解决办法
985
查看次数

标签 统计

iron-router ×1

meteor ×1