post_item.js 296 B

123456789101112
  1. Template.postItem.helpers({
  2. ownPost: function () {
  3. // Template is invoked in the context of a Post, so 'this' is a Post.
  4. return this.userId === Meteor.userId();
  5. },
  6. domain: function () {
  7. var a = document.createElement('a');
  8. a.href = this.url;
  9. return a.hostname;
  10. }
  11. });