I worked on a project that looks more like a structure and has several applications / modules that you can install. See this as the base storage appstore or google.play. This is a kind of intranet application, and all modules can be added to your user account.
the structure is already under development, but now I am enveloping the idea of applications / modules. ( link to proof of concept in development, can be found here )
the application should be somewhat autonomous and not able to suddenly include scripts from the framework. This is entirely possible by structuring them in separate modules:
angular.module('myApp', []);
however, the application can have templates, scripts, css and can run on a separate server, so I'm looking for the best way to get script (s) and cssfile and dynamically load them into the application when the user starts the app from within the frame.
- I am currently structuring applications as if they had a main template, for example
www.framework.com/apps/myapp/views/app.html , for simplicity I collected scripts into 1 script file for each application, so there is also www.framework.com/apps/myapp/script.js .
The structure contains a template that loads applications, and appController . The template contains this snippet:
<div data-ng-controller="AppController" data-ng-include="app.appTemplate"> <div>loading...</div> </div>
this is mainly associated with $scope.app.appTemplate , which is updated when all scripts are loaded, so first it shows the loading template, later after including scripts on the page, it updates app.appTemplate to the aforementioned main application template.
when loading the first index template it works, this template is currently loaded using the appController from the framework, so it uses the $scope framework, not its own script.
I still need to somehow run my own angular application module and allow it myself, without anything in the framework, to "make it work"
I am still figuring out what is the best way to load javascript dependent files (likely to use requrejs or another dependency loader), but currently I don’t know how to “load” the application without working within the appController
EDIT
I created a small demo project to show the problems at hand, the full code is visible on git-hub at the moment when this project makes several difficulties that I will make these less hard-coded when I get the proof of the concept correctly, now it's all about downloading applications in framework. if possible, I can figure out where to get the url and application names from ...