我下面就学习MeteorJS的教程,但是我得到调用“帐户”对象的方法“的createUser”当这个奇怪的错误:流星:未捕获的ReferenceError:应收没有定义
Meteor: Uncaught ReferenceError: Accounts is not defined
我抬头文档和Meteor提供了一个在您的项目中安装Meteor的完整账户系统。 (https://www.meteor.com/accounts)。这个错误的原因是什么?我无法找到答案。
我的代码:
if (Meteor.isClient) {
Template.login.creatingAccount = function()
{
return Session.get('creatingAccount');
},
Template.login.events({
'click #loginform': function()
{
Session.set('creatingAccount', false);
},
'click #accountform': function()
{
Session.set('creatingAccount', true);
},
'click #createAccount': function(e,t)
{
//make sure to show the login form
Session.set('creatingAccount', false);
Accounts.createUser({
username: t.find('#username').value,
password: t.find('#password').value,
email: t.find('#email').value,
profile: {
name: t.find("#username").value,
email: t.find("#email").value
}
});
},
});
}
谢谢,解决了它。我滚动回来,现在我明白发生了什么事。认为账户对象在流星本身是标准的! – Marciano 2015-02-11 10:42:53