Skip to content

Instantly share code, notes, and snippets.

@kingluddite
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kingluddite/786d8a46a2495574e0cd to your computer and use it in GitHub Desktop.
Save kingluddite/786d8a46a2495574e0cd to your computer and use it in GitHub Desktop.
Session.setDefault('appName', 'Project Manager');
<a class="navbar-brand" href="#">{{appName}}</a>
</div>
Template.Menu.appName = function() {
return Session.get('appName');
}
@kingluddite
Copy link
Author

Using sessions in meteor is essential. Here is how you do it. You create your default. To avoid problems put your sessions inside the client folder. I put default code in main.js so that it is run right away.

I then add the call to the session inside menu.html and it in turn uses menu.js to attach the session to that template by using Session.get('putYourSessionNameHere');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment