【发布时间】:2013-08-26 21:01:28
【问题描述】:
我是流星新手。我刚刚使用流星创建了一个 Hello world 项目。目前我的项目结构很简单。
- 根文件夹
- abc.css
- abc.html
- abc.js
在 abc.js 中,我只是尝试声明一个像这样的变量:
var lists = new Meteor.Collection("Lists");
if (Meteor.isClient) {
Template.hello.greeting = function () {
return "My List.";
};
Template.hello.events({
'click input' : function () {
if (typeof console !== 'undefined')
console.log("You pressed the button");
}
});
}
if (Meteor.isServer) {
Meteor.startup(function () {
});
}
但是当我运行它时,我在浏览器控制台中收到以下错误:
[18:17:32.895] ReferenceError: 列表未定义
我不确定我做错了什么。
【问题讨论】:
标签: javascript meteor