Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <template name="homePage">
- <h2>Welcome to home page!</h2>
- {{#each posts}}
- {{> postOnDay}}
- {{/each}}
- </template>
- <template name="postOnDay">
- <a href="#" class="aDay">{{day}}</a>
- <div style="display:{{showPost}}">
- {{note}}
- </div>
- </template>
- Template.homePage.helpers({
- posts: function() {
- //alert(Posts.find().count());
- return Posts.find();
- }
- });
- Template.postOnDay.events({
- 'click .aDay': function(e) {
- e.preventDefault();
- var link = e.currentTarget;
- showPost: 'inline' //change value on click
- }
- });
- Template.postOnDay.helpers({
- showPost: 'none' //default value
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement