Meteor Subscribe and Display Users Count

前端 未结 4 2022
太阳男子
太阳男子 2020-12-05 08:27

I\'m trying to display the number of users in my footer and I would like this number in real time. I think the proper way is to create a publication in the server and to sub

4条回答
  •  一生所求
    2020-12-05 09:19

    try this

    Template.footer.usercount = function () {
      return Meteor.users.find().count();
    };