I am working on a user profile page and I am trying to pass data from the controller to a template helper. Here's my controller:
usersDetailController = RouteController.extend({
waitOn: function () {
Meteor.subscribe('userProfileExtended', this.params._id);
},
data: function(){
console.log('info is ' + this.params._id);
var a = Meteor.users.findOne(this.params._id);
console.log(a);
return Meteor.users.findOne(this.params._id);
},
action: function() {
this.render('Users');
}
});
Here's my template helper:
Template.Users.helpers({
user: function() {
//define user based on the data context from the route controller
}
});
Can someone offer me some guidance on how to pass data that I defined in the controller in the template helper??
Thanks!!