Add css classes to <body> in Ember.js

2.4k views Asked by At

How to add css class to the body tag on specific route? I tried to use body tag in a handlebars template but didn't work...

Update: After some googling I came with this solution. Not sure that this is the best way to do this, but it works.

App.SomeRoute = Em.Route.extend
  activate: ->
    Em.$('body').addClass 'some-class'

  deactivate: ->
    Em.$('body').removeClass 'some-class'
0

There are 0 answers