This repository has been archived by the owner on Jan 18, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Championships Section
Jeremy Fourna edited this page Mar 18, 2016
·
4 revisions
This section of the app is based upon the following scripts/file/template :
client/templates/components/championships/championshipsWrapper.jade
- That calls the
ChampionshipsComponent
component. - This file is only needed for the routing.
client/templates/components/championships/championships.jade
- That house the
jade
template for theChampionshipsComponent
component. client/templates/components/championships/championships.js
- That house the
js
for theChampionshipsComponent
component.
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
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.
- Home
- Championships
- New Championship
- Championship detail
- Game detail
- My Account