Skip to content
Permalink
Browse files

Wired collection into `postsList` template

chapter4-3
  • Loading branch information
tmeasday committed Oct 19, 2015
1 parent f8080ff commit 974953ba197fdcff8b6bd6ce5682149e83985251
Showing with 3 additions and 18 deletions.
  1. +3 −15 client/templates/posts/posts_list.js
  2. +0 −3 server/fixtures.js
@@ -1,17 +1,5 @@
var postsData = [
{
title: 'Introducing Telescope',
url: 'http://sachagreif.com/introducing-telescope/'
},
{
title: 'Meteor',
url: 'http://meteor.com'
},
{
title: 'The Meteor Book',
url: 'http://themeteorbook.com'
}
];
Template.postsList.helpers({
posts: postsData
posts: function() {
return Posts.find();
}
});
@@ -1,19 +1,16 @@
if (Posts.find().count() === 0) {
Posts.insert({
title: 'Introducing Telescope',
author: 'Sacha Greif',
url: 'http://sachagreif.com/introducing-telescope/'
});

Posts.insert({
title: 'Meteor',
author: 'Tom Coleman',
url: 'http://meteor.com'
});

Posts.insert({
title: 'The Meteor Book',
author: 'Tom Coleman',
url: 'http://themeteorbook.com'
});
}

0 comments on commit 974953b

Please sign in to comment.
You can’t perform that action at this time.