【发布时间】:2017-05-25 12:26:42
【问题描述】:
我正在尝试使用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>
当我尝试浏览该页面时,我收到以下错误:
在传递调用“pages_tasks/CountPages”的结果时出现异常: 错误 在 Connection._livedata_result (http://localhost:3000/packages/ddp-client.js?hash=bc32a166cd269e06a394f9418e0024d805bab379:4736:23) 在 onMessage (http://localhost:3000/packages/ddp-client.js?hash=bc32a166cd269e06a394f9418e0024d805bab379:3385:12) 在http://localhost:3000/packages/ddp-client.js?hash=bc32a166cd269e06a394f9418e0024d805bab379:2736:11 在 Array.forEach (本机) 在 Function..each..forEach (http://localhost:3000/packages/underscore.js?hash=cde485f60699ff9aced3305f70189e39c665183c:149:11) 在 SockJS.self.socket.onmessage (http://localhost:3000/packages/ddp-client.js?hash=bc32a166cd269e06a394f9418e0024d805bab379:2735:11) 在 SockJS.REventTarget.dispatchEvent (http://localhost:3000/packages/ddp-client.js?hash=bc32a166cd269e06a394f9418e0024d805bab379:175:22) 在 SockJS._dispatchMessage (http://localhost:3000/packages/ddp-client.js?hash=bc32a166cd269e06a394f9418e0024d805bab379:1160:10) 在 SockJS._didMessage (http://localhost:3000/packages/ddp-client.js?hash=bc32a166cd269e06a394f9418e0024d805bab379:1218:18) 在 WebSocket.that.ws.onmessage (http://localhost:3000/packages/ddp-client.js?hash=bc32a166cd269e06a394f9418e0024d805bab379:1365:17)
有什么想法我可能做错了吗?
【问题讨论】:
标签: meteor