I have created a test app with user account-password and accounts-ui bootstrap and alanning roles, after I registered my account, i updated my user fields on meteor mongo shell, update role as admin. My problem is, how do i parse my data (profile) on a template?
I have this on my template
{{#each users }}
<tr>
<td>{{profile.company}}</td>
<td>{{profile.branch}}</td>
<td>{{email}}</td>
<td>{{password}}</td>
<td>{{roles}}</td>
<td>{{username}}</td>
<td> </td>
</tr>
{{/each }}
on my server
Meteor.publish('users', function () {
return users.find({});
});
on both clinet.server controller.js
UsersController = AppController.extend({
waitOn: function() {
return this.subscribe('users');
},
data: {
users: users.find({})
},
onAfterAction: function () {
Meta.setTitle('Users');
}
});
UsersController.events({
'click [data-action=doSomething]': function (event, template) {
event.preventDefault();
}
});
By the way, the roles and username are all parsing correctly for the current logged in user on the header.
{{currentUser.username}}<br> {{currentUser.roles}}
and then eventually, if the user profile successfully parsed, i can edit it as admin.
Adding user is next on my roadmap, i have to make this work before I move on to another.