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
# /client/views/teams.coffee | |
Template.teams.helpers | |
teams: [ | |
{name: 'Team 1'} | |
{name: 'Team 2'} | |
] |
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
// /client/views/teams.js | |
Template.teams.helpers({ | |
}); |
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
<!-- /client/main.html --> | |
<head> | |
<title>Foosboom</title> | |
</head> | |
<body> | |
<h1>Foosboom</h1> | |
{{> teams}} |
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
<!-- /client/views/teams.html --> | |
<template name="teams"> | |
<h3>Teams</h3> | |
</template> |
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
<!-- /client/main.html --> | |
<head> | |
<title>Foosboom</title> | |
</head> | |
<body> | |
<h1>Foosboom</h1> | |
</body> |
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
if(Meteor.isClient){ | |
//do client stuff | |
} |
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
id = Teams.findOne()._id | |
Teams.update(id, {$set: {name: 'Real Madrid'}}) |
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
# client/main.coffee | |
Meteor.subscribe 'teams' |
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:PRIMARY> db.teams.find() | |
{ "name" : "Barcelona", "_id" : "DsjnxpH7ZbEgmwrCY" } | |
{ "name" : "Manchester City", "_id" : "CbbrW3mLcNLK6vSAL" } |
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
# server/fixtures.coffee | |
if Teams.find().count() == 0 | |
[ | |
{name: 'Barcelona'} | |
{name: 'Manchester City'} | |
].forEach (data) -> Teams.insert(data) |