创建Meteor.Router.add()后显示[object object]的Meteor
Meteor showing [object Object] after creating Meteor.Router.add()
我将按照本教程学习Meteor。在添加了第一个JS代码之后,我在浏览器上获得了[object object]。我已经按照解释做了所有的事情(除了我更改了一些名字,但我没有使用任何保留词),但我看不到其他任何东西。这部分在前4分钟。我的文件是这样的:
演示.js:
CalEvents = new Meteor.Collection('calevents');
Session.setDefault('editing_calevent', null);
Session.setDefault('showEditEvent', false);
Meteor.Router.add({
'/':'home',
'/calendar':'calendar'
})
calendar.html:
<template name="calendar">
<div id="calendar">
Hello world! Now at calendar.
</div>
</template>
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>
演示.html:
<head>
<title>Calendar app</title>
</head>
<body>
{{>menu}}
<div class="container-fluid">
<div class="row-fluid">
{{renderPage}}
</div>
</div>
</body>
我怀疑这与Meteor.Router.add()行有关,因为我在添加之前所做的一点点工作都奏效了。我曾尝试将"/"上显示的页面更改为包含简单文本的其他页面,但没有成功。
编辑添加:我正在通过Nitrous.io工作,在添加路由器包之前我安装了Meteorite。
提前谢谢。
附言:我在这里和谷歌上搜索过,但一直找不到这个问题的答案。如果有,请给我指正确的地址。
许多使用0.8版本之前的Meteor的示例将不起作用,因此请确保查看最近更新的示例,如Discover Meteor上的示例。
在这种情况下,路由器已经修复为支持Meteor 0.8,您的示例将通过用{{> renderPage}}
替换{{renderPage}}
来工作。然而,这个例子的其余部分可能不起作用,正如其他人所提到的,路由器已经被Iron router否决了。
相关文章:
- Meteor如何接收HTTP请求
- Meteor-将选定窗体中的对象添加到集合中
- Meteor上的启动页面
- 函数未在Object.keys或Object.getOwnPropertyNames下列出,但可以调用
- Meteor方法在客户端返回null,在客户端运行的相同方法返回正确的值
- Meteor-添加用户自定义字段的方法不起作用
- Meteor忘记了密码的实现
- 链接所有<a>Meteor
- 在Meteor项目中安装并包含npm模块后出错
- delete在Object上效率低下,但在DOM Element's的数据属性,与null out相比
- Meteor JS中代码的重复使用部分
- Meteor Router数据函数被调用两次
- 基于localStorage的Meteor激活模板
- React+Meteor:this.ops返回未定义
- 如何将PHP get查询转换为Meteor's HTTP.get()
- 如何将javascript变量传递到Meteor Spacebars模板中
- 有没有一种方法可以列出Ember.Object的所有绑定
- Meteor.js: what object does {$set: {...} } get?
- Object's数据传递给Meteor.call时丢失
- 创建Meteor.Router.add()后显示[object object]的Meteor