Advertisement
Guest User

Untitled

a guest
Sep 16th, 2014
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <template name="homePage">
  2. <h2>Welcome to home page!</h2>
  3. {{#each posts}}
  4. {{> postOnDay}}
  5. {{/each}}
  6. </template>
  7.  
  8. <template name="postOnDay">
  9. <a href="#" class="aDay">{{day}}</a>
  10. <div style="display:{{showPost}}">
  11. {{note}}
  12. </div>
  13. </template>
  14.  
  15. Template.homePage.helpers({
  16. posts: function() {
  17. //alert(Posts.find().count());
  18. return Posts.find();
  19. }
  20. });
  21.  
  22. Template.postOnDay.events({
  23. 'click .aDay': function(e) {
  24. e.preventDefault();
  25. var link = e.currentTarget;
  26. showPost: 'inline' //change value on click
  27. }
  28. });
  29.  
  30. Template.postOnDay.helpers({
  31. showPost: 'none' //default value
  32. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement