Hello,
I'm working on AngularJS for a College Project, and I've run into a couple of bizarre errors that I cannot seem to solve. For one:
Whenever I try to navigate to my locally-hosted app using the properly-established routing, it cannot find the relevant files. To clarify, my routing files are such:
phonesApp.config(['$routeProvider',
function($routeProvider) {
$routeProvider
.when('/phones', {
templateUrl: 'partials/phone-list.html',
controller: 'PhoneListCtrl'
})
.otherwise({
redirectTo: '/phones'
});
}]);
Secondly, when I DO load the relevant files (by actually manually launching the index.html files), I get the following error:
Failed to instantiate module phoneCatApp due to:
Error: [$injector:modulerr] http://errors.angularjs.org/1.2.18/$injector/modulerr?p0=...)
at Error (native)
at file:///C:/Users/laptop%20user/Desktop/Y4/Semester%202/Software%20Frameworks/Week%203/labApps/scripts/angular.min.js:6:450
at file:///C:/Users/laptop%20user/Desktop/Y4/Semester%202/Software%20Frameworks/Week%203/labApps/scripts/angular.min.js:34:28
at Array.forEach (native)
at q (file:///C:/Users/laptop%20user/Desktop/Y4/Semester%202/Software%20Frameworks/Week%203/labApps/scripts/angular.min.js:7:280)
at e (file:///C:/Users/laptop%20user/Desktop/Y4/Semester%202/Software%20Frameworks/Week%203/labApps/scripts/angular.min.js:33:139)
at file:///C:/Users/laptop%20user/Desktop/Y4/Semester%202/Software%20Frameworks/Week%203/labApps/scripts/angular.min.js:33:216
at Array.forEach (native)
at q (file:///C:/Users/laptop%20user/Desktop/Y4/Semester%202/Software%20Frameworks/Week%203/labApps/scripts/angular.min.js:7:280)
at e (file:///C:/Users/laptop%20user/Desktop/Y4/Semester%202/Software%20Frameworks/Week%203/labApps/scripts/angular.min.js:33:139
I apologise for the large amounts of text here, but I simply don't understand. I checked the Internet, but the most common response was that this was due to not passing ngRoute as a parameter into your app, which is not the case here:
var phonesApp = angular.module('phoneCatApp', ['ngRoute']);
and to assure you that I'm associating the correct App.js file with the correct file, here is the beginning of index.html:
<html lang="en" ng-app="phoneCatApp">
Does anyone have any ideas?Thanks.