Created
May 15, 2012 18:33
-
-
Save livoffgrid/2704017 to your computer and use it in GitHub Desktop.
maintain selections in meteor
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
| Template.days.travelMode = function() { | |
| return ['DRIVING', 'BICYCLING', 'WALKING']; | |
| } | |
| Template.days.selected = function() { | |
| return Session.equals('travelMode', this.toString()) ? 'selected' : ''; | |
| } | |
| <template name='days'> | |
| ... | |
| {{#each travelMode}} | |
| <img id='{{this}}' class='mode {{selected}}' src='/{{this}}.png'> | |
| {{/each}} | |
| ... | |
| </template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment