Just diving into Angular and trying to figure out the best way to modularize my app.
app
toolbar
toolbar.module.js
menu.html
index.html
search.html
sub-system-1
subSystem1.module.js
directive-template.html
sub-system-2
subSystem2.module.js
directive-template.html
In the toolbar.module.js, I currently have 3 directives (menu, index, search) each with their own controller and service. It's becoming a bit confusing to maintain all the controllers, directive definitions, and services in one file.
I'm wondering if there's a way to organize this better so that each directive is in its own file along with its corresponding controller and service?
Maybe something like:
// menu.directive.js
var module = angular('toolbar.menu.directive',[]);
module.directives(...); // add menu directive to the module
Then within toolbar.modules:
// toolbar.module.js
var module = angular('toolbar',[toolbar.menu.directive]);
Is creating multiple fine-grained modules the only solution for achieving this level of organization?