AngularJs modules LazyLoading <p>At work we use a global module/main-app </p> <pre><code>&lt;html ng-app="mainApp" /&gt; </code></pre> <p>First of all, is it good or bad to use a global module?</p> <p>Second, I don't want to load all dependencies in this global module so I want to use a lazy loader, but what do you think of this solution?</p> <pre><code>// Set my module as main module $("#ng-app").attr("ng-app", "myModule"); // Load the global module and another directive var app = angular.module('myModule', ["mainApp", "angucomplete"]); </code></pre> <p>I want to mention that I am using <code>AngularJS</code> with <code>CodeIgniter</code> so I'm loading the JS script in view rather than include it in module dependencies.</p>