2015-03-19 171 views
2

使用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(); 
     } 
    });  
} 

回答

0

你只需要刪除用戶的報價

變化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