Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Allow appending to module definitions. #3881

@ProLoser

Description

@ProLoser

So... right now, you must do this:

  1. angular.module('myModule', ['dependency1', 'dependency2'])
  2. angular.module('myModule')

If you call 1 more than once, you wipe out your original module. If you call 2 first, you get an error (module undefined).

Right now, a problem exists with lazy-loading and asynchronous loading of assets. But what if you could simply supplement a module definition (instead of throwing errors or overriding it).

Lets say I want to load module.js and controller.js and directive.js asynchronously. But if anything other than module loads first, we get errors. If we add a dependency list in the other files, then the preceeding files are blown away.

Why don't we let you load in your crap in whatever order you want (even declaring the dependencies late) and only start throwing errors if these methods are called AFTER angular.bootstrap()?

This may not make lazy-loading perfect, but it would enable us to perform async loading with greater flexibility. Or perhaps async loading is not beneficial enough to bother with this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions