Skip to content

Instantly share code, notes, and snippets.

@remcoder

remcoder/welcome

Last active Aug 29, 2015
Embed
What would you like to do?
DemocratieLAB Welcome Screen Updates reactively
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
You can’t perform that action at this time.