我正在努力为我的Meteor JS应用程序提供一个非常基本的Iron Router实现,即使在查看了SO答案之后。我无法识别布局模板,当我转到localhost:3000时出现错误 - “找不到名为'layout'的模板你确定定义了吗?”
我有什么:
Router.js
Router.configure({
layoutTemplate: 'layout'
});
Router.map(function(){
this.route('feed', {path: '/'});
this.route('login', {path: '/login'});
this.route('profile', {path: '/profile'});
});
layout.html(在客户端文件夹中)
<template name="layout">
{{> yield}}
{{> navbar}}
</template>
navbar.html(在客户端文件夹中)
<template name="navbar">
<div id="footer-nav" class="text-center">
<input class="text-center" type="file" id="exampleInput">
</div>
</template>
好像是一个小虫,想法?谢谢!