Addressing the question using a selector such as body > .ember-view
works fine in development, but that will not work if your life, er, tests depend on it, since Ember mounts the app to the page differently in test environment.
Instead of...
<body>
<div class="ember-view">
<!-- app -->
</div>
</body>
... it mounts as...
<body>
<div id="ember-testing-container">
<div id="ember-testing">
<div class="ember-view">
<!-- app -->
</div>
</div>
</div>
</body>
This might not be an issue for most people, but for me it was - I was attaching a plugin to the root app selected via body > .ember-view
, which didn't work.
I was able to use .ember-view:eq(0)
instead, which grabs the first .ember-view
on the page - the app.