Module Not Loading Correctly

44 views
Skip to first unread message

Eoin Moloney

unread,
Feb 10, 2015, 5:54:35 AM2/10/15
to ang...@googlegroups.com
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=...)
    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.



Armando Couto - Gmail

unread,
Feb 10, 2015, 6:06:30 AM2/10/15
to ang...@googlegroups.com
Can attach the project?

--
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 angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.



--
Att
Armando Couto 
CSM - LKU

Eoin Moloney

unread,
Feb 10, 2015, 7:41:07 AM2/10/15
to ang...@googlegroups.com
OK. 
phoneCatalogueApp.zip

Armando Couto - Gmail

unread,
Feb 10, 2015, 8:03:36 AM2/10/15
to ang...@googlegroups.com
The problem is that you only had imported the angularJs and forgot to import the route dependence.
Simply Put:

<script type="text/javascript" src="https://code.angularjs.org/1.3.13/angular-route.js"></script>

2015-02-10 9:41 GMT-03:00 Eoin Moloney <king...@gmail.com>:
OK. 

--
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 angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Eoin Moloney

unread,
Feb 10, 2015, 8:40:03 AM2/10/15
to ang...@googlegroups.com
Where was that code supposed to be inserted? Because when I inserted it into the head portion of index.html, it still didn't work.

You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/HTAeJYWvnqw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.

Senthil Kumar

unread,
Feb 10, 2015, 8:53:05 AM2/10/15
to ang...@googlegroups.com
Hi,
the folder does not contain angularjs,js or jquery.js   files... you need to download the files and add the folder and reffer it in the index file....

Senthil Kumar

unread,
Feb 10, 2015, 8:55:15 AM2/10/15
to ang...@googlegroups.com


On Tuesday, February 10, 2015 at 7:10:03 PM UTC+5:30, Eoin Moloney wrote:

Armando Couto - Gmail

unread,
Feb 10, 2015, 8:58:22 AM2/10/15
to ang...@googlegroups.com
Looks like was:

<!-- <!doctype html> -->
<html lang="en" ng-app="phoneCatApp">
<head>
  <meta charset="utf-8">
  <title>Phone Gallery</title>
     <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.13/angular.min.js"></script>
     <script type="text/javascript" src="https://code.angularjs.org/1.3.13/angular-route.js"></script>
    <link href="../styles/bootstrap.min.css" rel="stylesheet">
    <link href="css/custom.css" rel="stylesheet" type="text/css">
<!-- These two were not in the lab but were suggested as help -->
<!-- These two were not in the lab but were suggested as help -->
</head>
<body>
    <div class="container-fluid">
      <div class="row">
          <div ng-view ></div>
      </div>
    </div>
          <script src="app.js"></script>
    </body>
</html>

Eoin Moloney

unread,
Feb 10, 2015, 9:07:40 AM2/10/15
to ang...@googlegroups.com
Bizarrely, even though I included the code just as you have it there, and even though the server is being launched from the same folder that index.html is in, the blasted thing still can't find index.html. What is going on?
Reply all
Reply to author
Forward
0 new messages