I have several simple pages that do not require a special application module, which must be specified in the attribute ng-app. But these pages also use some of my custom directives.
It seems to me that I put all my directives in a separate namespace (namely the module), i.e. MyApp.Directives.
This is great when I also provide my application module, because I add MyApp.Directivesas a dependency, and it works.
angular.module("MyApp", ["MyApp.Directives", ...])
But . As said, I also have very simple pages that really don't require any particular application module, because they don't need any user controllers or anything else. They are simply driven by attributes ng-.../ directives.
Question
I know that I can just add all my custom directives to the module ngand they will become available for all pages. Those who have a custom application module, and those who do not. But this exceeds the purpose of the modules, so I wonder if there is another way to tell the dependency injectors of my additional directives / filters?
, . ( AngularJS). , , , , ng , ng... Angular, , , .
manully angular.module("ng").requires, .