We are in the process of setting up our angular app and adhering to industry-standard practices.
Our app.js file is responsible for configuring ngRoute routes, with a mainController specified in the markup:
<body ng-controller='mainController'>...</body>
In addition to this, we have defined several other routes and controllers within our app.js. The usage of directives throughout our HTML code is also crucial.
While it is not mandatory for JS code to rely on injected directives, they must be included somewhere in a dependency list to function properly within Angular.
We strive to maintain good practice by keeping the dependency lists for each module as focused as possible - avoiding listing every single dependency in app.js. At present, we have placed the directives dependency in the mainController.js file, even though it is not utilized by that specific controller.
The question remains: where should we correctly include the directives module as a dependency?
Should we simply add it at the top-level in app.js??
Any insight on this matter would be greatly appreciated!