Controller not defined AngularJS
<p>I get <a href="https://docs.angularjs.org/error/ng/areq?p0=CampaignsSettingsController&amp;p1=not%20a%20function,%20got%20undefined" rel="nofollow">this error</a> when I try to run my application.</p>

<pre><code>Argument 'CampaignsSettingsController' is not a function, got undefined
</code></pre>

<p>My controller is defined here:</p>

<pre class="lang-js prettyprint-override"><code>// Called Second
var campaignsSettingsModule;
campaignsSettingsModule = angular.module('campaignsSettings');
campaignsSettingsModule.controller(
    'CampaignsSettingsController', [
        '$scope',
        '$window',
        'CampaignAdvancedSettings',
        function($scope, $window, CampaignAdvancedSettings) {
            // my controller code here
        }
    ]
);
</code></pre>

<p>And the <code>campaignSettings</code> module is called like this:</p>

<pre class="lang-js prettyprint-override"><code>// Called first
var modules = ['evApp', 'campaignsSettings'];

for (var i = 0, length = modules.length; i &lt; length; i++) {
    angular.module(modules[i], []).config(function($interpolateProvider){
        $interpolateProvider.startSymbol('{[').endSymbol(']}');
    });
}
</code></pre>

<p>The order in which these files are called (dunno if it makes a difference) is indicated above the code.</p>

<p>What would be the reason for getting the undefined error? Where can I start looking into solving this problem. I've read through various answers here, but I still can't get it fixed.</p>