I've been reviewing my JavaScript code thoroughly, but I can't seem to pinpoint any major issues. The error message I'm encountering is as follows:
Uncaught Error: [$injector:modulerr] Failed to instantiate module careApp due to:
Error: [$injector:nomod] Module 'careApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
I have double-checked and confirmed that I am using the correct modules and dependencies. Everything seems to be correctly spelled and in order.
I suspect the issue may lie within the $routeProvider
section of my JavaScript code...
'use strict';
(function() {
var AppCtrl;
AppCtrl = function() {
function AppCtrl($scope) {
$scope.list = [{
label: 'Main Menu',
icon: 'fa fa-home fa-fw 4x',
link: '#/homePage',
move: function() {
console.log("HOME");
}
}, {
label: 'Patient',
icon: 'fa fa-user fa-fw 4x',
link: '#/pCredential',
move: function() {
console.log("PATIENT");
}
}, {
label: 'Technician',
icon: 'fa fa-user-md fa-fw 4x',
link: '#/tLogin',
move: function() {
console.log("TECHNICIAN");
}
}, {
label: 'Administrator',
icon: 'fa fa-cogs fa-fw 4x',
link: '#/aLogin',
move: function() {
console.log("ADMINISTRATOR");
}
}];
}
return AppCtrl;
}();
angular.module('careApp', [
'ngRoute',
'ngMaterial',
'ngAria',
'ngAnimate'
])
.config(['$routeProvider', function($routeProvider) {
$routeProvider
.when('#/homePage' {
template: '<p>WELCOME HOME!</p>'
}).
when('#/pCredential' {
template: '<p>INSERT CREDENTIALS INTO NODE.</p>'
}).
when('#/tLogin' {
template: '<p>PLEASE LOGIN TO THE TECHNICIAN PAGE.</p><p>GET CREDENTIALS FROM OWNER.</p>'
}).
when('#/aLogin' {
template: '<p>ADMINISTRATOR ACCESS.</p>'
})
//load default page on page refresh
.otherwise({
redirectTo: '/appLaunch'
});
}])
.controller('AppCtrl', ['$scope', AppCtrl]);
}());
To view the current Fiddle, click here: https://jsfiddle.net/Miega/mowwckze/3/
If anyone could offer assistance, it would be greatly appreciated.