仅在顶部添加了 1 行代码
Only added 1 line of code at the top
我不知道我必须做什么才能让它工作,这里是代码:
Songs = new Mongo.Collections("songs");
if (Meteor.isClient) {
// counter starts at 0
Session.setDefault('counter', 0);
Template.hello.helpers({
counter: function () {
return Session.get('counter');
}
});
Template.hello.events({
'click button': function () {
// increment the counter when button is clicked
Session.set('counter', Session.get('counter') + 1);
}
});
}
if (Meteor.isServer) {
Meteor.startup(function () {
// code to run on server at startup
});
}
这是错误:类型错误:未定义不是函数 在Newapp.js:1:9
我所做的只是添加 1 行。另外,我将如何在浏览器Javascript控制台中运行适当的Javascript代码以将项目插入歌曲集合中。我是初学者。
使用 Mongo.Collection
而不是 Mongo.Collections
。 最后s
是没有必要的。
相关文章:
- 将 jQuery 代码添加到 Index.aspx 页面
- Javascript代码添加了一些不应该存在的内容
- 将Google AdWords转换跟踪(javascript)代码添加到PrestaShop/Smarty页面中
- 向以下代码添加不接受“0”的另一个条件
- 如何为该代码添加回调函数
- 将javascript代码添加到URL
- jquery将HTML代码添加到页面中
- jQuery/can'我找不到避免代码添加类的方法
- 如何将我自己的验证代码添加到MooTools的lightface表单中
- 需要帮助将一些JavaScript代码添加到我的wordpress主题中
- 将 JQuery 或 Javascript(不是 coffee.script)代码添加到 Rails 3.2 应用程序中
- JQuery 悬停代码:添加 If 语句会破坏它
- 如何在jsp中单击按钮时将代码添加到jqPlot条形图另存为图像
- JavaScript 将代码添加到已经设置的事件中
- 仅将 Javascript 代码添加到最后一个文本区域
- 如何使用此示例使用 javascript 将代码添加到我的表单标签中
- 将 Jquery 无冲突代码添加到我当前的代码中
- 如何将自定义代码添加到prestashop
- 调试JavaScript和css代码:添加一个事件处理程序
- Dojo 使用 domConstruct 将声明性代码添加到现有手风琴中