Our current setup for angularjs applications involves a file named "app.js" which contains
var app = angular.module('VolumeOutputOptions', [
'someDirectiveModule',
'someServiceModule'
]);
Most classes rely on this global variable, except for code shared across applications such as someDirectiveModule. This reliance has resulted in occasional issues when a new dependency is added without including it in all relevant contexts where "app" is utilized. Global variables can be messy.
Is there a more efficient way to share a single module among all directives and controllers within an application? For instance, would
angular.module('VolumeOutputOptions').directive(...);
angular.module('VolumeOutputOptions').controller(...);
create two separate modules with the same name, or does Angular automatically merge them?