0
我不知道我必須做的,讓在這裏工作是代碼:只加1行代碼頂部
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
});
}
這裏是錯誤: 類型錯誤:未定義不功能 at newapp.js:1:9
我所做的只是添加了1行。另外,我將如何在瀏覽器的Javascript控制檯中運行適當的Javascript代碼,以將項目插入到Songs集合中。 我是初學者。
謝謝。對於愚蠢的問題抱歉。 –
享受閱讀和學習流星:) –