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'
});
}]);
Yet, when I start http-server -p 7070 and go to
http://localhost:7070/phoneCatalogueApp/#/phones, I am told that no files
can be found.
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=...
<http://errors.angularjs.org/1.2.18/$injector/modulerr?p0=ngRoute&p1=Error%3A%20%5B%24injector%3Anomod%5D%20http%3A%2F%2Ferrors.angularjs.org%2F1.2.18%2F%24injector%2Fnomod%3Fp0%3DngRoute%0A%20%20%20%20at%20Error%20(native)%0A%20%20%20%20at%20file%3A%2F%2F%2FC%3A%2FUsers%2Flaptop%2520user%2FDesktop%2FY4%2FSemester%25202%2FSoftware%2520Frameworks%2FWeek%25203%2FlabApps%2Fscripts%2Fangular.min.js%3A6%3A450%0A%20%20%20%20at%20file%3A%2F%2F%2FC%3A%2FUsers%2Flaptop%2520user%2FDesktop%2FY4%2FSemester%25202%2FSoftware%2520Frameworks%2FWeek%25203%2FlabApps%2Fscripts%2Fangular.min.js%3A20%3A466%0A%20%20%20%20at%20file%3A%2F%2F%2FC%3A%2FUsers%2Flaptop%2520user%2FDesktop%2FY4%2FSemester%25202%2FSoftware%2520Frameworks%2FWeek%25203%2FlabApps%2Fscripts%2Fangular.min.js%3A21%3A469%0A%20%20%20%20at%20file%3A%2F%2F%2FC%3A%2FUsers%2Flaptop%2520user%2FDesktop%2FY4%2FSemester%25202%2FSoftware%2520Frameworks%2FWeek%25203%2FlabApps%2Fscripts%2Fangular.min.js%3A33%3A199%0A%20%20%20%20at%20Array.forEach%20(native)%0A%20%20%20%20at%20q%20(file%3A%2F%2F%2FC%3A%2FUsers%2Flaptop%2520user%2FDesktop%2FY4%2FSemester%25202%2FSoftware%2520Frameworks%2FWeek%25203%2FlabApps%2Fscripts%2Fangular.min.js%3A7%3A280)%0A%20%20%20%20at%20e%20(file%3A%2F%2F%2FC%3A%2FUsers%2Flaptop%2520user%2FDesktop%2FY4%2FSemester%25202%2FSoftware%2520Frameworks%2FWeek%25203%2FlabApps%2Fscripts%2Fangular.min.js%3A33%3A139)%0A%20%20%20%20at%20file%3A%2F%2F%2FC%3A%2FUsers%2Flaptop%2520user%2FDesktop%2FY4%2FSemester%25202%2FSoftware%2520Frameworks%2FWeek%25203%2FlabApps%2Fscripts%2Fangular.min.js%3A33%3A216%0A%20%20%20%20at%20Array.forEach%20(native>)
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.
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.