meteor js iron router: apply CSS change whenever route changes
问题 I have homepage, contact page, and several other product related pages in my app. The goal is to apply a background image to ONLY specifc routes: /homepage and /contact . If user navigates away from either route, apply some css change. I am hacking this together now with a helper on my homepage, like so: Template.homepage.rendered = function () { var route = Router.current(); if ( route.path == '/' ) { document.body.className = "showBackgroundImage"; } }; Partial win here, since this will