If i get you correctly, you have something like that (thx http://asciiflow.com/ for the schema) :
+-index.html-------+---+--------+---------+-+
| +------menu.html| +---------cart.html| |
| | Ember App | | Ember App | |
| | | | | |
| +---+---------+-+ +-------+-+--------+ |
| +----main.html--+---+-------+ |else.html |
| | | | | |
| | | | Ember | |
| | Ember App | | App | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | +--------+ |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| +---------------------------+ |
+--+---------------------------+------------+
If so, you indeed have 2 options.
- Either you use named outlet (example, documentation)
To do this, each of the indexes of your various apps would have to be moved to a template named after its feature role or position for instance.
In a nutshell (in the main index.html, position name approach):
<div class="header-left">{{outlet headerleft}}</div>
<div class="header-right">{{outlet headerright}}</div>
<div class="sidebar">{{outlet sidebar}}</div>
<div class="main">{{outlet main}}</div>
And in your IndexRoute
:
App.IndexRoute = App.Route.extend({
renderTemplate: function() {
this.render('headerleftTpl', {// the template to render
into: 'index', // the template to render into
outlet: 'headerleft', // the name of the outlet in that template
controller: 'HeaderLeftCtrl'// the controller to use for the template
});
this.render('headerrightTpl', {
into: 'index',
outlet: 'index',
controller: 'HeaderRightCtrl'
});
// And so on
}
});
- Or you use component, which is also a nice(r) solution in term of architecture.
However, this will require a lot of refactoring to convert all your apps into components.
And the philosophy behind components is that they should be quite isolated so it might not fit your purpose (for this part, I can't know for you)
Here is a nice tutorial to convert a view into a Component.
- Note that in both cases, it will be a quite some work to convert. My first impression is that it's easier to move to a named outlet first and then try to move toward the component solution which tends to be the new standard with Web Components.