Well, I'm not able to get a controller to work in a simple example which code looks like:
app.js:
(function() {
'use strict';
// Define AngularJS application
var myApp = angular.module('myApp', [
'ngRoute'
]);
// Set application routes
myApp.config(['$routeProvider','$locationProvider',function($routeProvider,$locationProvider) {
$routeProvider
.when('/registration', {
templateUrl: 'views/registration.html',
controller: 'registrationController'
})
.otherwise({
redirectTo: '/'
});
}]);
})();
registration.js:
(function() {
'use strict';
myApp.controller('registrationController', [
'$scope',
'$routeParams',
'$rootScope',
'$location',
function(
$scope,
$routeParams,
$rootScope,
$location
){
}
]);
})();
no clue why but it throws an error
registration.js:4 Uncaught ReferenceError: myApp is not defined