2

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

1 に答える 1

0

ユーザーの引用符を削除するだけです

doc="user"に変更doc=user

テンプレートは次のようになります

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

このMeteorPadをチェックしてください

于 2015-09-28T22:54:22.233 に答える