Skip to content

Instantly share code, notes, and snippets.

@gabrielhpugliese
Created October 22, 2012 00:34
Show Gist options
  • Save gabrielhpugliese/3929083 to your computer and use it in GitHub Desktop.
Save gabrielhpugliese/3929083 to your computer and use it in GitHub Desktop.
Facebook trouble
Template.body.connected = function(){
return Meteor.userLoaded();
};
Template.body.have_game = function(){
//get into game ...
}
Template.index.created = function(){
//list facebook friends
}
Template.body.created = function() {
Session.set('have_game', false);
};
Template.body.have_game = function() {
// Do some stuff first then:
return Session.get('have_game');
}
// Templates:
<template name="body">
{{#if connected}}
{{#if have_game}}
{{> game}}
{{/if}}
{{#unless have_game}}
{{> index}}
{{/unless}}
{{/if}}
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment