Skip to content

Instantly share code, notes, and snippets.

@properapp
properapp / meteor-page-title.coffee
Last active August 29, 2015 13:56
Meteor - Iron Router: Set Current Page Title
Template.layoutAuthenticated.rendered = ->
# Get the page title (set in the router)
pageTitle = Session.get 'currentPageTitle'
if pageTitle
document.title = pageTitle + ' | Proper'
else
document.title = 'Proper'
@properapp
properapp / gist:7034835
Created October 18, 2013 00:51
Example of using a localStorage check to test if a browser has access to local storage and using the check as a before filter in Iron Router for Meteor.
# Function to check localStorage availability
hasStorage = ->
try
mod = new Date
localStorage.setItem mod, mod.toString()
result = localStorage.getItem(mod) == mod.toString()
localStorage.removeItem mod
return result