我正在使用useraccounts:ionic包为我的应用程序注册,该包在内部使用useraccounts:core。
我创建了包含三个字段Full Name、Email和Password的表单。在默认注册表单中,全名字段不存在,所以,我这样添加,
AccountsTemplates.addField({
_id: 'fullname',
type: 'text',
displayName: "Full Name",
required: true
});
而且我不想要确认密码。所以,删除了它。
AccountsTemplates.configure({
confirmPassword: false,
....
});
但现在我要重新排列字段。IE
|=====================|
| Full Name |
|=====================|
| Email |
|=====================|
| Password |
|=====================|
在通过meteor-useraccounts/core Guide之后。
这是我的代码:
var pwd = AccountsTemplates.removeField('password');
var email = AccountsTemplates.removeField('email');
AccountsTemplates.addField([
{
_id: 'fullname',
type: 'text',
displayName: "Full Name",
required: true
},
email,
pwd
]);
它向我扔了这个error
:
Exception in template helper: TypeError: Cannot read property 'form' of undefined
这是我在MeteorPad的代码