Hi all, I’m new to Meteor (and any kind of back-end in general), and I’m having some trouble displaying a list of registered users. Right now it’s coming back blank, but with the correct number of rows in the table. Here’s the html:
<template name="users">
<h2>Users</h2>
<table>
<tr><th>Email</th></tr>
{{#each users}}
{{> user}}
{{/each}}
</table>
</template>
<template name="user">
<tr><td>{{userEmail}}</td></tr>
</template>
The publish:
Meteor.publish('users', function() {
return Meteor.users.find({}, {fields:{emails:1}});
})
The subscribe:
Meteor.subscribe('users');
The helper:
Template.users.helpers({
users: function(){ return Meteor.users.find(); },
userEmail: function() { return this.emails[0].address; },
});
I’m not having any trouble with other collections, but maybe I’m missing something with the users collection. Since the table has the correct number of rows, it appears that the publish/subscribe is going through correctly.
Thanks in advance for the help.