Skip to content
This repository has been archived by the owner on Jan 18, 2019. It is now read-only.

Championships Section

Jeremy Fourna edited this page Mar 18, 2016 · 4 revisions

Championships page

This section of the app is based upon the following scripts/file/template :

Routing

lib/router.js

Router.route('/championships', {
	name: 'championshipsWrapper',
	waitOn() {
		return subscriptions.subscribe('allChampionships');
	},
	fastRender: true
});

name : It's the jade name of the template

waitOn() : We wait to display to page until we subscribe to the allChampionships publication

fastRender : We by pass the waitOn param to display only the html that don't need data

Publications

server/publications/championshipsPublications.js

Meteor.publish('allChampionships', function() {
	return Championships.find({}, {
		fields: {
			name: 1,
			public: 1,
			_id: 1
		},
		sort: {
			name: 1
		}
	});
});

In the allChampionships publication we send back all the name, public properties of the championships. We also sort the championships by name A to Z.

App

Collections schema

Collections methods

How to contribute

Clone this wiki locally