流星 - Autoform与Meteor.users集合

问题描述:

使用Autoform和Meteor.users创建一个小测试。如果我创建自己的收藏集,那很好。但不知何故,与我不断收到这个错误,我不知道什么是错的..流星 - Autoform与Meteor.users集合

错误:

Uncaught RangeError: Maximum call stack size exceeded 
14autoform-inputs.js:162 Uncaught TypeError: Cannot read property 'formValues' of undefined 

模板:

{{> loginButtons}} 

    <div class="container"> 
     <h2>update</h2> 
     {{> update }} 
    </div> 
</body> 

<template name="update"> 
    {{> quickForm collection="Meteor.users" 
       id="update-user-profile" 
       type="update" 
       doc="user" 
      }} 
</template> 

与助手返回当前用户方案:

Meteor.users.attachSchema(new SimpleSchema({ 
    country: { 
     type: String, 
     label: "Country" 
    }, 
    city: { 
     type: String, 
     label: "city" 
    }, 
    email: { 
     type: String, 
     label: "email" 
    }, 
    story: { 
     type: String, 
     label: "your story", 
     optional: true, 
     max: 1000 
    } 
})); 

if (Meteor.isClient) { 

    Template.update.helpers({ 
     user: function(){ 
      return Meteor.userId(); 
     } 
    });  
} 

你只需要删除用户的报价

变化doc="user"doc=user

您的模板应该是这样的

<template name="update"> 
    {{> quickForm collection="Meteor.users" 
       id="update-user-profile" 
       type="update" 
       doc=user 
      }} 
</template> 

看看这个MeteorPad

+0

嘿感谢你的回答和链接,但我没有看到一个工作版本在MEteorPad中运行,实际上我什么都看不到,刷新(浏览器或键盘本身)都不起作用。你确定这是正确的吗?或者我在这里做错了什么 – flowen 2015-10-02 12:21:53