angular/angular.js — pull request #1721 by justmoon (2012-12-18 03:56:16+00:00)
Title: feat($injector): allow loading of modules to an existing injector

When working on larger applications it is desirable to have individual parts loaded on demand, rather than loading everything at once in the beginning.

Unfortunately, there is no way to load a new module to an existing injector after the injector has been instantiated. And we also can't create a new injector because we would have a separate `$rootScope` and separate instances of services etc.

As far as I understand dynamically loading modules is planned for Angular 2.x, but our project needs the functionality now.

This patch exposes the module loading functionality in the injector. With access to this low-level function, applications can implement their own loading behavior.

I'm happy to add docs and tests to this pull request, but I wanted to get a reaction from the Angular devs first.

Related discussion:
https://groups.google.com/d/topic/angular/rs1dj097oHA/discussion