Skip to content

Instantly share code, notes, and snippets.

@aaronthorp
Created May 28, 2015 07:33
Show Gist options
  • Save aaronthorp/e98d2978816be2eb94da to your computer and use it in GitHub Desktop.
Save aaronthorp/e98d2978816be2eb94da to your computer and use it in GitHub Desktop.
template level meteror method for user details select
Template.chatItem.onCreated(function() {
var instance = Template.instance();
instance.member = new ReactiveVar();
instance.autorun(function() {
var id = this.userId;
Meteor.call('getMember', id, function(err, data) {
instance.member.set(data);
});
});
});
Template.chatItem.helpers({
member: function() {
return Template.instance().member.get();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment