Error while running angular js html page on a server

612 views Asked by At

When I'm running my HTML page through a server I'm always getting an error with my angular JavaScript file included. But it runs fine without local server in Mozilla Firefox and Safari but not with Google Chrome (XML errors with Google Chrome).

//localhost:8000/Users/harsha/Documents/angular%20js/nganimate.js
Failed to load resource: the server responded with a status of 404 (File not found)
Failed to load resource: the server responded with a status of 404 (File not found) angular.js:4361Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.4.0/$injector/modulerr?p0=controllerapp&p1=Er…ogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.4.0%2Fangular.min.js%3A19%3A264)

The Screenshot of error message in console

enter image description here

2

There are 2 answers

1
NeiL On

You have error in js file path .

//localhost:8000/Users/harsha/Documents/angular%20js/nganimate.js  

So index file is unable to locate the file.

1
Walfrat On

Users/harsha/Documents/angular%20js/nganimate.js

The path of your server isn't the one from your C: it's relative from where your start your server. If you need us to figure out from where your server start, you need to tell us what is the server.

And if it's the grunt web server, show us your build file.