Vulcan/packages/telescope-comments/lib/client/templates/comment_controller/comment_controller.js

19 lines
486 B
JavaScript
Raw Normal View History

2015-09-17 14:51:14 +09:00
Template.comment_controller.onCreated(function () {
var template = this;
var commentId = FlowRouter.getParam("_id");
template.subscribe('singleCommentAndChildren', commentId);
if (FlowRouter.getRouteName() === "commentPage") {
template.subscribe('commentUsers', commentId);
template.subscribe('commentPost', commentId);
}
});
Template.comment_controller.helpers({
data: function () {
return {comment: Comments.findOne(FlowRouter.getParam("_id"))};
}
});