- embrace module structure (1x require = module is available)
// my/app.js
require('../dep/app');
angular.module('myApp', ['dep']);
require('./value');
require('./directive');
// my/value.js
angular.module('myApp').value('myValue', 'foo');
// my/directive.js
angular.module('myApp').directive('myDirective', function(depService, myValue) {
/* ... */
});
// dep/app.js
angular.module('dep', []);
require('./service');
// dep/service.js
angular.module('dep').service('depService', /* ... */);
Add the module to the dependencies of wrapper/cms/siteadmin frame app
// wrapperFrameApp.js
require('./my/app');
angular.module('wrapperFrameApp', [..., 'myApp']);