I'm having problems structuring a frontend with AngularJS. I have a backend based on OSGi, a plugin based architecture with Java. Every plugin/bundle in OSGi, has a lifecycle: INSTALLED->RESOLVED->STARTED->STOPPING->STOPPED->UNINSTALLED, etc.
I am able to handle this in the backend without problems.
Now, in the frontend I'm building an application with a main module with AngularJS. That module should depend on all others, but as you see, these dependencies are dynamic. A few modules could be available, while others not. Some modules could be started after the application has bootstrapped or stopped.
I can't achieve this kind of dynamism with Angular so far, because once the main module has bootstrapped it can not add/remove new dependencies in real time.
Angular separates the routes, controllers, directives, factories, etc among modules through dependencies.
How should I solve this?
Any recommendation will be appreciated.

Would you mind providing a simplified example of what you are trying to achieve? I mean an example of couple of modules, how they relate to what you call "main module" and how you expect the Angular app to behave as those change their states.
– Milen DyankovFeb 17 '17 at 9:53

1 Answer
1

Not sure if this is still relevant to you, but you can create a bundle for rest endpoints and allow your OSGi environment to manage the dynamic nature of your system so the frontend doesn't have to handle it.