我有一個與流星和FullCalendar包(rzymek:fullcalendar)的問題,如果我直接定義事件數組它顯示的事件,但如果我從我的集合即使Find方法在控制檯中工作並向我顯示我的事件(事件數組在控制檯中顯示爲空),它甚至不會填充數組。 我沒有刪除自動發佈或不安全的軟件包:這是一個基本測試。流星從集合的完整日曆事件數組沒有渲染
main.js文件:
if (Meteor.isServer) {
Meteor.startup(function() {
if (Meetings.find().count() === 0) {
Meetings.insert({
title: 'All Day Event',
start: '2015-02-06'
});
}
});
}
if (Meteor.isClient) {
/* //this array of events shows if uncommented
events = [
{
title: 'reuni',
start: '2015-02-06'
}
]*/
Template.calendar.helpers({
options: function() {
return {
events: events
}
}
});
}
我collection.js文件(lib文件夾內):
Meetings = new Mongo.Collection('meetings');
events = Meetings.find({}, {fields: {_id:0} }).fetch(); /*This will only show an empty array and not the events array that I fetch*/
您是否在應用程序中自動發佈? – jimmiebtlr 2015-02-05 15:58:36
是的。我正在使用自動發佈測試 – mesosteros 2015-02-05 16:03:49