I am building a chat application and on my \"new chats\" page I have a list of contacts, which you can select one by one by tapping them (upon which I apply a CSS selected class
You could use a local Meteor.Collection
cursor as a reactive data source:
var NewChatters = new Meteor.Collection("null");
Template:
{{#each newChatters}}
- {{username}}
{{/each}}
Event:
Template.contactsLayout.events({
'click #contactItem': function (e) {
NewChatters.insert({username: this.username});
}
});
Helper:
Template.newChatDetails.helpers({
newChatters: function() { return NewChatters.find(); }
});