New to Angular, trying to figure out how I should 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
The toolbar.module.js for example has 3 directives (menu, index, search) and each directive has its own controller, service. All the controllers, directive definitions and services are defined in the toolbar.module.js...kind of confusing when it comes to maintaining the code.
Is it possible to come up with a finer grained setup such that each directive is enclosed in its own file along side its controller & service?
I figure I could add:
menu.directive.js
And inside there have something like
var module = angular('toolbar.menu.directive',[]);
module.directives(...);//add menu directive to the module
Then inside toolbar.modules have something like:
var module = angular('toolbar',[toolbar.menu.directive]);
Is this the only way I can achieve this by defining lots of fine-grained modules?