【问题标题】:Autoform and FlowRouter with template level subscriptions within Meteor.js在 Meteor.js 中具有模板级订阅的 Autoform 和 FlowRouter
【发布时间】:2016-05-26 13:45:51
【问题描述】:

在使用 FlowRouter 时,我似乎无法弄清楚如何创建有效的 Autoform“QuickForm”。我不断收到此错误:

Exception in template helper: Error: Footer is not in the window scope

这是我的快速表单。在这种情况下,集合等于“页脚”的字符串值:

{{> quickForm id="formView" type="insert" collection=form.collection }}

也许一个 Quickform、simpleSchema 和 FlowRouter 的例子足以回答这个问题。

【问题讨论】:

  • 你有一个名为Footer的模板吗?
  • 不,我的收藏被称为页脚​​,但即:Footer = new Mongo.Collection('footer');

标签: javascript meteor meteor-autoform simple-schema flow-router


【解决方案1】:

我意识到我的问题是创建集合的文件和呈现 Quickform 的模板文件位于单独的包中!

我将api.export("Footer",['client', 'server']); 添加到正确的包中,一切正常!

注意:我还不知道这是否是推荐的方法,或者此解决方案是否存在安全问题,因此暂时不会将其标记为正确。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-22
    • 2013-11-15
    相关资源
    最近更新 更多