Я получаю 2 ошибки с моим приложением meteor. Ниже приведены ошибки. Я использую account-ui-bootstrap-3, и я пытаюсь отобразить свой шаблон заголовка внутри layout.html
.Meteor Uncaught TypeError: Не удается прочитать свойство 'push' of undefined
Вот мои 2 ошибки с некоторым кодом.
Uncaught TypeError: Cannot read property 'push' of undefined
Uncaught Error: There are multiple templates named 'layout'. Each template needs a unique name.
^^ Даже если у меня есть только один шаблон с именем layout.
Код:
layout.html
<template name="layout">
<div class="container">
{{>header}}
<div id="main" class="row-fluid">
{{>yield}}
</div>
</div>
</template>
header.html
<template name="header">
<header class="navbar">
<div class="navbar-inner">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="{{pathFor 'postsList'}}">Test</a>
<div class="nav-collapse collapse">
<ul class="nav pull-right">
<li>{{> loginButtons}}</li>
</ul>
</div>
</div>
</header>
</template>
Почему не отображает loginbuttons?
Router.js
Router.configure({
layoutTemplate: 'layout',
loadingTemplate: 'loading',
waitOn: function() { return Meteor.subscribe('posts'); }
});
Router.map(function() {
this.route('postsList', {path: '/'});
this.route('postPage', {
path: '/posts/:_id',
data: function() { return Posts.findOne(this.params._id); }
});
});
Как выглядит ваш router.js? – cwahlfeldt
Я добавлю, что сейчас! – crsMC