Skip to content

Instantly share code, notes, and snippets.

@ncammarata
Created September 2, 2012 20:17
Show Gist options
  • Save ncammarata/3604169 to your computer and use it in GitHub Desktop.
Save ncammarata/3604169 to your computer and use it in GitHub Desktop.
Template.beatles.created = function() {
this.i_say = 'Hello';
this.you_say = 'Good Bye'
this.who = 'i'
}
Template.beatles.events({
'change select': function() { this.who = $(e.target).val(); }
});
Template.beatles.lyrics = function() { return this[this.who + '_say']; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment