Ember 2.4 change main view css class


#1

I’m looking for a way to change the css classname of the root element of an Ember app in Ember 2.4.

The old way doesn’t work anymore because of deprecation, and now I have :

<body class="ember-application">
   <div id="ember414" class="ember-view">
     <!-- THE WHOLE APP -->
   </div>
</body>

I’m looking for making something like :

<body class="ember-application">
   <div id="ember414" class="ember-view theCssClass">
     <!-- THE WHOLE APP -->
   </div>
</body>

Thanks a lot for your help !


#2

The easiest way to do this, without deprecation and/or mega hacks, is to invoke a component from your application template. Something like:

{{#app-style-wrapper}}
  {{! Other stuff that is in application template now }}
  {{outlet}}
{{/app-style-wrapper}}