Skip to content

Instantly share code, notes, and snippets.

@niallobrien
Created July 13, 2015 00:14
Show Gist options
  • Save niallobrien/2540c379e8c339df1c0d to your computer and use it in GitHub Desktop.
Save niallobrien/2540c379e8c339df1c0d to your computer and use it in GitHub Desktop.
Template.profile.onCreated(function () {
this.subscribe('profile', Router.current().params.username)
})
Template.profile.events({
'click .follow-me': function (event, template) {
console.log(template.data) // null
//Meteor.call('follow', this.user._id);
}
});
Template.profile.helpers({
user: function () {
return Meteor.users.findOne({username: Router.current().params.username})
},
following: function () {
return this.user && _(Meteor.user().profile.followingIds).contains(this.user._id);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment