我正在嘗試使用meteor-pages。在我的JavaScript代碼,我有:流星 - 分頁
Tasks = new Mongo.Collection("tasks");
Tasks.attachSchema(new SimpleSchema({
title: {
type: String,
label: "Title",
max: 200
},
complete: {
type: Boolean,
defaultValue: false,
label: " ",
autoform: {
type: "boolean-checkbox"
}
},
dueDate: {
type: Date,
label: "Due Date",
optional: true,
autoform: {
type: "pickadate"
}
}
}));
Pages = new Meteor.Pagination(Tasks, {
templateName: "tasksPaginated"
})
在我的html,我有:
<template name="TaskList">
Before
{{> tasksPaginated}}
After
</template>
<template name="tasksPaginated">
{{> pages}}
{{> pagesNav}} Bottom navigation
</template>
當我嘗試瀏覽頁面時,我得到以下錯誤:
Exception in delivering result of invoking 'pages_tasks/CountPages': Error at Connection._livedata_result (http://localhost:3000/packages/ddp-client.js?hash=bc32a166cd269e06a394f9418e0024d805bab379:4736:23) at onMessage (http://localhost:3000/packages/ddp-client.js?hash=bc32a166cd269e06a394f9418e0024d805bab379:3385:12) at http://localhost:3000/packages/ddp-client.js?hash=bc32a166cd269e06a394f9418e0024d805bab379:2736:11 at Array.forEach (native) at Function..each..forEach (http://localhost:3000/packages/underscore.js?hash=cde485f60699ff9aced3305f70189e39c665183c:149:11) at SockJS.self.socket.onmessage (http://localhost:3000/packages/ddp-client.js?hash=bc32a166cd269e06a394f9418e0024d805bab379:2735:11) at SockJS.REventTarget.dispatchEvent (http://localhost:3000/packages/ddp-client.js?hash=bc32a166cd269e06a394f9418e0024d805bab379:175:22) at SockJS._dispatchMessage (http://localhost:3000/packages/ddp-client.js?hash=bc32a166cd269e06a394f9418e0024d805bab379:1160:10) at SockJS._didMessage (http://localhost:3000/packages/ddp-client.js?hash=bc32a166cd269e06a394f9418e0024d805bab379:1218:18) at WebSocket.that.ws.onmessage (http://localhost:3000/packages/ddp-client.js?hash=bc32a166cd269e06a394f9418e0024d805bab379:1365:17)
任何想法我可能做錯了什麼?
當我這樣做:this.Pages =新Meteor.Pagination(「任務」);,我得到的錯誤: 「‘任務’關口選舉是在之外創建的。將集合對象而不是集合名稱傳遞給構造函數。 [收藏不可訪問]」 –
user472292