我在我的Meteor应用程序中使用Autoform,模式如下:
Projects = new Mongo.Collection('Projects');
Projects.attachSchema(new SimpleSchema({
title: {
type: String,
label: "Project Title"
},
tiles: {
type: [Object],
label: "Tiles",
optional: true
},
"tiles.$": {
type: Array,
optional: true
},
"tiles.$.description": {
type: String,
label: "Tile Description",
optional: true
}
}));在我的模板中,我有以下自定义autoForm:
{{#autoForm collection="Projects" doc=this id="updateProjectInfo" type="update"}}
{{> afQuickField name="title"}}
{{> afArrayField name="tiles" template="AdminEditTile"}}
<button type="submit" class="btn btn-primary">SAVE</button>
{{/autoForm}}然后是afArrayField的模板:
<template name="afArrayField_AdminEditTile">
{{> afFormGroup name="this.current.description"}}
</template>但是,我在浏览器Exception in template helper: Error: Invalid field name: this.current.description中收到一个错误
我以前见过一些人使用表单this.atts.description,但这也不起作用。我是不是漏掉了什么?
发布于 2015-11-09 23:44:27
您必须删除双引号。
name=this.current.descriptionhttps://stackoverflow.com/questions/32127336
复制相似问题