Created
July 13, 2015 00:14
-
-
Save niallobrien/2540c379e8c339df1c0d to your computer and use it in GitHub Desktop.
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.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