Last active
August 29, 2015 14:14
-
-
Save remcoder/1132544b72c4d83a7ec3 to your computer and use it in GitHub Desktop.
DemocratieLAB Welcome Screen Updates reactively
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
Classes = new Mongo.Collection(‘classes’); | |
Classes.insert({ | |
location: "Aa en Hunze", | |
schoolType: "Basisonderwijs", | |
route: "42", | |
active: true | |
}); | |
<button data-action=continue | |
class="fade {{#if activeClass}}visible{{/if}}">ga verder | |
</button> | |
Template.player_welcome.helpers({ | |
activeClass : function() { | |
// this is where the magic happens: whenever the result of this 'livequery' changes, | |
// the surrounding helper function is re-run automatically | |
return Classes.findOne({ active:true }); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment