Ember Cli append HTML to body tag, before the script tags

The default ember cli app would add html to body tag, after script tags.

So, it will be kinda like this:

<body>
    <script src="assets/vendor.js"></script>
    <script src="assets/compile.js"></script>
    <header>
        <h1>Page Title</h1>
    </header>
</body>

I want to put the code right after the body tag, before the script tags:

<body>
    <header>
        <h1>Page Title</h1>
    </header>
    <script src="assets/vendor.js"></script>
    <script src="assets/compile.js"></script>     
</body>

I can specify the rootElement in app.js, but if I specify body tag, it still adds the html code below script tags. The only way it works is if i set kind of a ‘wrapper’ like so:

rootElement: '.wrapper'

and the result will be:

<body>
    <div class="wrapper">
        <header>
            <h1>Page Title</h1>
        </header>
    </div>
    <script src="assets/vendor.js"></script>
    <script src="assets/compile.js"></script>     
</body>

But why the hell on earth would I need this wrapper ? (it is like a stone age, i hate that approach)

Is there a way to specify the location right after the body tag, before the scripts tag?

1 Like