Reputation: 928
I would like to use one app, but state that in view A, use style sheet bla, and in view B use style sheet other. How could I achieve this using ember - or is this possible?
Upvotes: 1
Views: 176
Reputation: 8389
You could use the didInsertElement
hook of the view to dynamically load a stylesheet and willDestroyElement
to unload a stylesheet. There are a number of SO questions/answers describing how to do the loading/unloading, which is not Ember-specific.
Timing may be a little tricky because loading stylesheets is asynchronous, and will take time depending on server response time, latency, etc.
In most cases, it isn't worth the trouble to do this, but of course when you need to, you need to...
See the docs for Ember.View
for more information about the lifecycle hooks I mentioned: http://emberjs.com/api/classes/Ember.View.html#event_didInsertElement
Upvotes: 1