Created
May 28, 2015 07:33
-
-
Save aaronthorp/e98d2978816be2eb94da to your computer and use it in GitHub Desktop.
template level meteror method for user details select
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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