Last active
August 29, 2015 14:08
-
-
Save alexharris/b89da1844fa5b24a872c to your computer and use it in GitHub Desktop.
publications.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Template.linksList.helpers({ | |
| links: function() { | |
| return Links.find(); | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Meteor.publish('links', function() { | |
| var links = Links.find(); | |
| var tagTitles = links.map(function(p) { return p.tagTitle }); | |
| return [ | |
| links, | |
| Tags.find({_id: {$in: tagTitles}}) | |
| ]; | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Router.configure({ | |
| layoutTemplate: 'layout', | |
| loadingTemplate: 'loading', | |
| notFoundTemplate: 'notFound', | |
| waitOn: function() { | |
| return [Meteor.subscribe('links')]; | |
| } | |
| }); | |
| Router.route('/', {name: 'linksList'}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment