MainController.js
(function(){
var eateryControllers=angular.module('eateryControllers',[]);
eateryControllers.controller('MainController',function(){
var mainCtrl=this;
});
})();
ReservationController.js
(function(){
var eateryControllers=angular.module('eateryControllers');
eateryControllers.controller('ReservationController',reservationController);
function reservationController(){
var resvnCtrl=this;
resvnCtrl.user={};
}
})();
I am creating module in first file and reusing the same module in second file.
Error
http://errors.angularjs.org/1.4.7/ng/areq?p0=ReservationController&p1=not%20aNaNunction%2C%20got%20undefined
at Error (native)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js:6:416
at qb (https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js:22:131)
at Sa (https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js:22:218)
at b.$get (https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js:80:81)
at g.link (https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular-route.min.js:7:268)
at aa