I get this error when I try to run my application.
Argument 'CampaignsSettingsController' is not a function, got undefined
My controller is defined here:
// Called Second
var campaignsSettingsModule;
campaignsSettingsModule = angular.module('campaignsSettings');
campaignsSettingsModule.controller(
'CampaignsSettingsController', [
'$scope',
'$window',
'CampaignAdvancedSettings',
function($scope, $window, CampaignAdvancedSettings) {
// my controller code here
}
]
);
And the campaignSettings
module is called like this:
// Called first
var modules = ['evApp', 'campaignsSettings'];
for (var i = 0, length = modules.length; i < length; i++) {
angular.module(modules[i], []).config(function($interpolateProvider){
$interpolateProvider.startSymbol('{[').endSymbol(']}');
});
}
The order in which these files are called (dunno if it makes a difference) is indicated above the code.
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.
angular.module('thisModuleName', ['inject', 'your', 'modules', 'here'])
also, dont wrap it in for loop. It looks weird. – The Green Foxx Jul 29 at 8:09