0
오류가 발생했을 때 meteor에서 사용자 계정으로 작업하고있었습니다. 내 userEmail
도우미 기능에 콘솔에 오류가 인쇄되어 있습니다. 내 질문은 그것이 undefined
인 경우 왜 출력을 얻는 것입니까? 템플릿 도우미의 예외 : TypeError : 정의되지 않은 '0'속성을 읽을 수 없습니다.
Template.Users.helpers({
user: function(){
return Meteor.users.find();
},
userEmail:function(){
return this.emails[0].address;
},
student:function(){
return this.profile.profession === 'student';
}
});
은'emails' 키는 기본적으로 게시되지 않습니다. 사용자 게시는 어떤 모습입니까? –
템플릿은'return Meteor.user(). emails [0]'이어야합니다. 'accounts-facebook' 등 'accounts-password'를 사용하지 않는다면'emails'도 존재하지 않을지라도 – JeremyK
나는 accounts-password를 사용하고있다. –