简体   繁体   中英

Error while running angular js html page on a server

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

在此处输入图片说明

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM