首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用现有数据填充autoform 6.0

无法使用现有数据填充autoform 6.0
EN

Stack Overflow用户
提问于 2017-03-06 07:32:25
回答 1查看 284关注 0票数 2

我已经更新到simple-schema npm并安装了autoform6.0,但是我似乎无法成功地为集合生成表单。我得到这个错误,Exception in template helper: TypeError: Cannot read property 'mergedSchema' of undefined,我不知道它指的是什么,因为这是一个新的构建,所以它不应该引用任何旧的autoform或simple-schema包。

路径:imports/ui/pages/candidate-registration/contact-information/contact-information.html

代码语言:javascript
复制
<template name="App_contactInformation">
  {{#with profile}}
    {{firstName}}
      {{> quickForm collection=Profile id="updateProfile" type="update"}}
    {{/with}}
  {{/if}}
</template>

路径:imports/ui/pages/candidate-registration/contact-information/contact-information.js

代码语言:javascript
复制
import { Profile } from '/imports/api/profile/profile.js';
import './contact-information.html';

Template.App_contactInformation.onCreated(function () {
  this.autorun(() => {
    this.subscribe('private.profile');
  });
});

Template.App_contactInformation.helpers({
  profile() {
    var user = Profile.findOne({userId: Meteor.userId()});
    return user;
    }
});

路径:imports/api/profile/server/publications.js

代码语言:javascript
复制
// All profile-related publications

import { Meteor } from 'meteor/meteor';
import { Profile } from '../profile.js';

Meteor.publish('private.profile', function() {
  if (!this.userId) {
    return this.ready();
  }
  return Profile.find({"userId": this.userId});
});
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-03-17 14:06:28

确保您也在使用aldeed:collection2-core并拥有attached your schema to your collection。例如..。

代码语言:javascript
复制
Books.attachSchema(Schemas.Book);
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42615342

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档