Skip to content

Commit 974953b

Browse files
committedOct 19, 2015
Wired collection into postsList template
chapter4-3
1 parent f8080ff commit 974953b

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed
 

‎client/templates/posts/posts_list.js

+3-15
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
1-
var postsData = [
2-
{
3-
title: 'Introducing Telescope',
4-
url: 'http://sachagreif.com/introducing-telescope/'
5-
},
6-
{
7-
title: 'Meteor',
8-
url: 'http://meteor.com'
9-
},
10-
{
11-
title: 'The Meteor Book',
12-
url: 'http://themeteorbook.com'
13-
}
14-
];
151
Template.postsList.helpers({
16-
posts: postsData
2+
posts: function() {
3+
return Posts.find();
4+
}
175
});

‎server/fixtures.js

-3
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
if (Posts.find().count() === 0) {
22
Posts.insert({
33
title: 'Introducing Telescope',
4-
author: 'Sacha Greif',
54
url: 'http://sachagreif.com/introducing-telescope/'
65
});
76

87
Posts.insert({
98
title: 'Meteor',
10-
author: 'Tom Coleman',
119
url: 'http://meteor.com'
1210
});
1311

1412
Posts.insert({
1513
title: 'The Meteor Book',
16-
author: 'Tom Coleman',
1714
url: 'http://themeteorbook.com'
1815
});
1916
}

0 commit comments

Comments
 (0)
Please sign in to comment.