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
<template name="example"> | |
<select class="form-control" name="select"> | |
{{#each teams}} | |
<!-- | |
Here, ../team (../ is a Handlebars convention for traversing template scope) allows us to get the team | |
value from the parent template (i.e. {{team}}). this._id allows us to get the _id value of the current | |
item being iterated, or in this example, the _id of the current team. Our UI helper matches the current | |
team against the current option, if they match, that option is displayed as selected in the select box. | |
--> | |
<option {{selectOption ../team this._id}} value="{{_id}}">{{name}}</option> |
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
Template.signup.events( | |
'submit form': (e,t) -> | |
# Prevent form from submitting. | |
e.preventDefault() | |
# Grab the user's details. | |
user = | |
email: t.find('[name="emailAddress"]').value | |
password: t.find('[name="password"]').value |
NewerOlder