【发布时间】:2017-11-20 14:43:35
【问题描述】:
我想以表格格式显示所有用户信息,作为管理页面的一部分。我也使用了流星帐户 ui 包。
HTML代码是:
{{#each userList}}
<tbody>
<tr>
<th scope="row">*</th>
<td>{{infofullname}}</td>
<td>{{infosurname}}</td>
<td>{{infoemail}}</td>
</tr>
</tbody>
{{/each}}
问题在于显示的是当前用户的信息,而不是所有注册用户的信息。迭代确实会发生,但对于当前登录的用户。也没有显示电子邮件地址。
帮助代码是:
Template.students.helpers({
userList: function(){
return Meteor.users.find({});
},
infofullname: function(){
return Meteor.user().profile.fullname;
},
infosurname: function(){
return Meteor.user().profile.surname;
},
infoemails: function(){
return Meteor.user().emails.[0].address;
}
});
我面临以下问题: 1) 电子邮件地址未显示。 2)没有显示所有用户的信息。
谢谢。
【问题讨论】:
-
你能展示你的出版物吗?这就是将数据传递给客户端以显示的内容。
-
@MichelFloyd 我还没有创建出版物。出版物在这里有什么用处?如何为这种情况定义出版物?我是流星新手。
标签: meteor meteor-blaze meteor-accounts