Error: [ng:areq] Argument 'ControllerName' is not a function, got undefined

Viewed 7593

In app.js I have:

(function(){
    var app = angular.module("myApp", []);
})();

in process.js which is included after app.js I have:

(function(){
    app.controller('ProcessController', ['$http', function($http){
        this.something = "Test"
    }]);
});

and in my HTML file I have a div

<html class="no-js" lang="en" ng-app="myApp">
...
   <div class="row" ng-controller="ProcessController">

This is throwing an error in my console:

Error: [ng:areq] Argument 'ProcessController' is not a function, got undefined

I'm pretty new to angular and have never used multiple files like this before. What am I doing wrong?

4 Answers
Related