Embed an application created using ember-cli (where to specify rootElement?)

I need to embed an ember application made with ember-cli in an existing website.

Without ember-cli, I would do this:

App = Ember.Application.create({
  rootElement: '#app-container'
});

Basically, I want to include the generated assets in my page and not use the index.html file at all .. (The application should be attached to the div element, and not to the body element.)

+4
source share
1 answer

Wow. I can not believe that I have not tried to do this.

var App = Ember.Application.extend({
  modulePrefix: 'kontrollpanel', // TODO: loaded via config
  Resolver: Resolver,
  rootElement: '#myapp'
});

I guess I was confused by using Application.extend () instead of Application.create (). Regarding the ember-cli extension, I found the answer here: SO: Why ember cli uses the extension instead of creating

+5
source

All Articles