This file contains 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 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 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 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 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 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 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 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> | |
<ul> | |
{{#each teams}} | |
<li>{{name}}</li> | |
{{/each}} | |
</ul> | |
</template> |
This file contains 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> | |
{{#if creating}} | |
<form class="form-create"> | |
<input name="name" type="text"> | |
<button type="submit">Submit</button> | |
<a class="cancel" href="#">Cancel</a> | |
</form> |
This file contains 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: -> Teams.find() | |
creating: -> Session.get 'creating' | |
Template.teams.events | |
"click .create": (e, tpl) -> | |
e.preventDefault() | |
Session.set 'creating', true |