Allow for anonymous sub-modules
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.