【发布时间】:2015-01-25 18:36:11
【问题描述】:
早上好,
我使用了 aldeed 的 simple-schema 和 collection2 没有任何问题。我现在想要的是使用自动表单包(https://github.com/aldeed/meteor-autoform#a-basic-insert-form),更具体地说是其中一个示例。
为简单起见,我仍在尝试使第一个示例工作:
autoform.html
<head>
<title>autoForm</title>
</head>
<body>
{{> insertBookForm}}
</body>
<template name="insertBookForm">
{{> quickForm collection="Books" id="insertBookForm" type="insert"}}
</template>
common.js
Books = new Mongo.Collection("books");
Books.attachSchema(new SimpleSchema({
title: {
type: String,
label: "Title",
max: 200
},
author: {
type: String,
label: "Author"
},
copies: {
type: Number,
label: "Number of copies",
min: 0
},
lastCheckedOut: {
type: Date,
label: "Last date this book was checked out",
optional: true
},
summary: {
type: String,
label: "Brief summary",
optional: true,
max: 1000
}
}));
问题是我总是得到一个空白页。流星应用终端没有显示错误。
最好的问候
【问题讨论】:
标签: javascript meteor handlebars.js