meteor - Dynamic dispalying of data based on fields of a collection -
so, have collection of documents following fields (id, usera, userb, message). (document name room) want name room based on user logged in. ie if user want userb displayed , vice versa. have code below , seems outputting userb time. suggestions appreciated.
<template name="rooms"> <h4>contacts:</h4> <ul> {{#each rooms}} {{> room}} {{/each}} </ul>
<template name="room"> <li style="cursor: pointer; {{roomstyle}}"> {{#if userais}} {{userb}} {{/if}} </li>
});
template.room.helpers({ userais: function(usera) { return this.usera==meteor.userid(); }
});
Comments
Post a Comment