Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Oct 10, 2022. It is now read-only.
This repository was archived by the owner on Oct 10, 2022. It is now read-only.

Allow for anonymous sub-modules #6

@nikku

Description

@nikku

Sometimes it does not matter how sub-modules are named.

In these cases, it should be possible to name sub-modules on-the-fly following simple convention over configuration.

Consider the following case

module.js:

ngDefine('some.plugin', [
  'module:some.plugin.nested:./nested'
], function(module) {
});

nested.js:

ngDefine('some.plugin.nested', function(module) {
  // module definition
});

It is required to type the nested plugin name multiple times (each in a separate file).
This is cumbersome and error prone.

Using some loading magic we should be able to simplify the setup by allowing implicit sub-modules based on parent > child dependencies.

The resulting structure could look like this:

module.js:

ngDefine('some.plugin', [
  'module:./nested'
], function(module) {
});

Assumes nested AngularJS module to be named some.plugin.nested (due to module location).

nested.js:

ngDefine(function(module) {
  // module definition
});

Defines the AngularJS module some.plugin.nested as it is loaded via some.plugin > ./nested.

Checks have to be done to ensure that the module loaded is not loaded twice under different names.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions