0
ウェブフォームのメインページにスキーマを添付して自動フォームを表示しようとしています。Autoform:変数がウィンドウスコープにありません
私は次のエラーを取得する:
Uncaught Error: Inventory is not in the window scope
server.js
:
SimpleSchema.extendOptions(['autoform']);
import SimpleSchema from 'simpl-schema';
Inventory = new Mongo.Collection('inventory');
Inventory.attachSchema(new SimpleSchema({
customTonerName: {
type: String,
label: 'Custom Toner'
},
quantity: {
type: Number,
label: 'Quantity'
}
}));
メインテンプレート:あなたはこのために2つのソリューションを提供
{{#autoForm collection="Inventory" id="insertInventoryForm" type="insert"}}
{{> afQuickField name='quantity'}}
{{/autoForm}}
は、 "現在のスコープ内にある"ヘルパー "または"プロパティ "または"変数 "をインベントリ" –