铁:路由器 - “找不到名为'loading'的模板......”

时间:2015-03-30 12:05:26

标签: javascript meteor iron-router

我得到了这个奇怪的错误:

" 无法找到名为' loading'的模板。或者' loading'你确定你定义了吗?"

就像Iron router: Error: Couldn't find a template named "/" or "". Are you sure you defined it?

一样

不幸的是,答案并不是很有帮助(可能是因为它已经老了,我已经使用了1.0.7版本。)

这里是铁配置javascript:

Router.configure({
    layoutTemplate: 'layout',
    loadingTemplate: 'loading',
    waitOn: function() { return Meteor.subscribe('posts'); }
});

Router.route('/', {name: 'postsList'});

有什么暗示吗? ^ _ ^

1 个答案:

答案 0 :(得分:3)

多么棒的StackOverflow开始......我跟随"发现流星"书,不知怎的,我跳过了添加实际微调器的下一部分..

添加以下代码解决了我的问题:

<template name="loading">
    {{>spinner}}
</template>

猜猜我需要管理我的快速阅读技巧,对不起。

相关问题