I'm setting up my routing for a AngularJS v1.6 app, but I am running into a slight problem.
I am getting the following error, and I can't seem to figure out what is wrong. I hope you guys can shed some light into my error.
Uncaught Error: [$injector:modulerr] <http://errors.angularjs.org/1.6.1/$injector/modulerr?p0=app&p1=Error%3A%20%…ogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.6.1%2Fangular.min.js%3A21%3A332>)
at angular.js:38
at angular.js:4759
at q (angular.js:357)
at g (angular.js:4720)
at eb (angular.js:4642)
at c (angular.js:1838)
at Mc (angular.js:1859)
at pe (angular.js:1744)
at angular.js:32977
at HTMLDocument.b (angular.js:3314)
Below is my code:
app.js;
(function () {
"use strict";
angular.module("app", [
"ngRoute",
"app.home",
"app.products",
"app.contact"
])
.config(function ($routeProvider) {
$routeProvider
.when("/",
{
controller: "homeController",
templateUrl: "app/components/home/home.html"
})
.when("/products",
{
controller: "productsController",
templateUrl: "app/components/products/products.html"
})
.when("/contact",
{
controller: "contactController",
templateUrl: "app/components/contact/contact.html"
});
});
})();
This is one of my controller (All 3 are the same) ...
(function() {
"use strict";
angular
.module("app.home", [])
.controller("homeController", homeController);
function homeController() {
this.helloWorld = "Hello World";
}
});