【发布时间】:2016-05-17 22:26:59
【问题描述】:
我有一个带有集合的架构:
export const Cources = new Meteor.Collection('Cources');
Cources.schema = new SimpleSchema({
courcePath: {
type: String,
label: 'Cource path'
},
courceTitle: {
type: String,
label: 'Cource title',
max: 200
},
courceDescription: {
type: String,
label: 'Cource description'
},
lessonsNumber: {
type: Number,
label: 'Lessons number',
min: 1
},
courceDuration: {
type: String,
label: 'Cource duration'
}
});
Cources.attachSchema(Cources.schema);
和模板:
<template name="AddCource_page">
<div class="container">
{{> quickForm collection="Cources" id="insertCourceForm" type="insert"}}
</div>
</template>
但是,表单未呈现,并且控制台出现错误:Error: Cources is not in the window scope。当我添加助手时,同样的问题。我该如何解决?谢谢。
【问题讨论】:
-
您的意思可能是
Course而不是Cource。无论如何,如果您删除export const,它是否有效? -
尝试删除
Course.schema,改用coursesSchema