创建Meteor.Router.add()后,Meteor显示[object Object]

Hol*_*ola 1 javascript router meteor

我正在按照本教程学习Meteor.添加第一个JS代码后,我在浏览器上获得[object Object].我已按照所解释的一切(除了一些我已经改变的名字,但我没有使用任何保留的词),但我看不到任何其他内容.这部分是在前4分钟.这是我的文件的样子:

demonstration.js:

CalEvents = new Meteor.Collection('calevents');
Session.setDefault('editing_calevent', null);
Session.setDefault('showEditEvent', false);
Meteor.Router.add({
    '/':'home',
    '/calendar':'calendar'  
})
Run Code Online (Sandbox Code Playgroud)

calendar.html:

<template name="calendar">
    <div id="calendar">
        Hello world! Now at calendar.
    </div>
</template>
Run Code Online (Sandbox Code Playgroud)

home.html的:

<template name="home">
    <div class="hero-unit">
        <p>Manage your calendar</p>
        <p><a class="btn btn-primary btn-large">Learn more</a></p>
    </div>  
</template>
Run Code Online (Sandbox Code Playgroud)

demonstration.html:

<head>
  <title>Calendar app</title>
</head>

<body>
  {{>menu}}
    <div class="container-fluid">
        <div class="row-fluid"> 
            {{renderPage}}
        </div>
    </div>
</body>
Run Code Online (Sandbox Code Playgroud)

我怀疑它与Meteor.Router.add()行有关,因为我在添加它之前做的很少.我已经尝试将页面更改为显示在包含简单文本的其他页面上的"/",但它不起作用.

编辑添加:我正在通过Nitrous.io工作,我在添加路由器包之前安装了Meteorite.

提前致谢.

PS:我在这里和谷歌搜索过,但我找不到这个问题的答案.如果有,请将我指向正确的地址.

And*_*Mao 5

许多在0.8版之前使用Meteor的示例都不起作用,因此请确保查看最近更新的示例,例如Discover Meteor上的示例.

在这种情况下,路由器已经被固定在支架流星0.8和你的榜样将通过更换工作{{renderPage}}{{> renderPage}}.但是,该示例的其余部分可能无法正常工作,并且正如其他人所提到的,路由器已被弃用于Iron Router.