Parent app containing child apps, like a portal


#1

Hi, I have a question regarding a portal or dashboard type app. The scenerio is that I’d have a main dashboard app which can include n number of child applications, with the child apps being visible depending on user role …

This would mean that the main-dashboard would have it’s own namespaced Ember.App, own router etc … and the child applications would have their own namespaced Ember.App with router etc …

Is this possible?

I’m about to try npm linking a child ember-cli app with it’s dashboard app but thought I’d throw out the question. So again : Parent app with many child apps … is this possible? Cheers, Stephen.


#2

I’m not so expert of the Ember deeps, but it should be possible wrapping each emebr app in its own namespace, as you suggested, but then you should replicate the code of ember for each name space (as ember as some function directly pending from Ember.*, as Ember.App etc), right?

So whats the point of having different isolated apps? If it is for role policy, you can simply hide functionality depending on the user’s role, and not serving not-want-to-see data from the backend for that role.


#3

well, there’s lots of reasons, the main one being that we can have different teams working on isolated apps that could then be orchastrated by the enclosing application, based on role location etc … It enables a module architect and keeps us out of the monolith hell which inadvertently becomes the case over time … /Stephen.


#4

although … I guess your right. We could have teams working on the views etc but what about the routes … if we had everything in one app we’d need some way of merging the routes … Unless we could keep them seperate? /Stephen.


#5

Hi Guys, I’v managed to get my child app running in my parent app with the aid of oasis.js which is totally cool!! I ammended the following into the parents Brocfile :

var pickFiles = require('broccoli-static-compiler');

var EmberApp = require('ember-cli/lib/broccoli/ember-app');

var app = new EmberApp();

var m1app = pickFiles('bower_components/m1-ui/dist', {
        srcDir: '/',
        files: ['assets/*.*', 'index.html'],
        destDir: '/m1-ui'
 });

module.exports = app.toTree(m1app);

Now this is all fine and dandy … but what I’d really like to do is use the child app as an addon … I’v done this with models, services in an addon project but would love to be able to refer to the child apps App … Is just the case that I can move the childs app content into an childapp/addon dir or … Should I create an addon project and create an Ember.Application inside of that? The reason I want to do this is so that I can have two apps side by side or even more. Cheers, Stephen.