【发布时间】:2018-03-02 01:51:06
【问题描述】:
假设我做了所有像 aldeed 描述的 here 那样创建自定义表单模板。我忘记了什么或者autoform标签不存在的错误在哪里?
实际的 html 示例:
<template name="afType_talkBar">
{{#autoform schema=Schema.Nachrichten id="sendMessageForm" type="insert"}}
<fieldset class="clubChat__input">
<div class="clubChat__message-bar">
{{> afQuickField name='chatroomId'}}
{{> afQuickField name='userName'}}
<div class="form-group{{#if afFieldIsInvalid name='content'}} has-error{{/if}}">
<div class="input-group">
<span class="input-group-addon">$</span>
{{> afFieldInput name='content'}}
<span class="input-group-addon">/each</span>
</div>
{{#if afFieldIsInvalid name='content'}}
<span class="help-block">{{afFieldMessage name='content'}}</span>
{{/if}}
</div>
<input type="submit" value="{{_ 'chatAction.send'}}">
</div>
</fieldset>
{{/autoform}}
</template>
还有客户端talkBar.js
import './talkBar.html';
// Import necessary js Packages
import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import { Nachrichten } from '../../../api/nachrichten/nachrichten';
奖金问题。插入
Template.talkBar.helpers({
nachrichtenCollection(){
return Nachrichten;
}
});
导致 Uncaught TypeError: Cannot read property 'helpers' of undefined
看起来我缺少一些基本的东西
【问题讨论】:
标签: javascript meteor meteor-blaze meteor-autoform simple-schema