我目前正在做一個簡單的流星應用程序,它需要顯示除當前登錄用戶以外的所有用戶。流星顯示當前登錄用戶以外的所有用戶
這裏是我的「用戶」模板,顯示所有用戶:
<template name="friends">
{{#each listUser}}
<p id="userNameOnList">{{profile.firstname}} {{profile.lastname}} <a href="#" class="btn btn-primary btnAddFriend">Add Friend</a></p>
{{/each}}
</template>
這是我的模板助手:
Template.friends.helpers({
listUser: function(){
return Meteor.users.find({},{sort:{'profile.firstname': 1}});
}
});
我有點自丟在這裏,你能上給出出主意我如何處理這個問題?謝謝!
它的工作,謝謝你!我一直在堅持。 – ickyrr