I just set up a new angular app and I'm encountering an issue where my controller is not registering. The error message I am receiving states:
The controller with the name 'DashboardController' is not registered.
My app module and dashboard controller are in separate files, as shown below:
app.js:
var MyApp = (function () {
'use strict';
angular.module('MyApp', []);
})();
DashboardController:
(function () {
'use strict';
MyApp.controller('DashboardController', []);
var vm = this;
vm.title = 'DashboardController';
})();
In my HTML file, I am trying to display the title:
<body ng-controller="DashboardController">
{{title}}
<!-- JS Scripts -->
<script src="Scripts/jquery-3.1.1.min.js"></script>
<script src="Scripts/bootstrap.min.js"></script>
<script src="Scripts/angular.js"></script>
<!-- Application Directive -->
<script src="Scripts/controllers/app.js"></script>
<!-- Controllers -->
<script src="Scripts/controllers/DashboardController.js"></script>
</body>
Any suggestions on what might be missing or causing this issue would be greatly appreciated.