简体   繁体   English

在服务器上运行angular js html页面时出错

[英]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. 当我通过服务器运行HTML页面时,包含的角度JavaScript文件总是出现错误。 But it runs fine without local server in Mozilla Firefox and Safari but not with Google Chrome (XML errors with Google Chrome). 但在Mozilla Firefox和Safari中没有本地服务器的情况下,它运行良好,但在Google Chrome浏览器中则无法运行(Google Chrome浏览器出现XML错误)。

//localhost:8000/Users/harsha/Documents/angular%20js/nganimate.js //localhost:8000/Users/harsha/Documents/angular%20js/nganimate.js
Failed to load resource: the server responded with a status of 404 (File not found) 加载资源失败:服务器响应状态为404(找不到文件)
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) 无法加载资源:服务器响应状态为404(找不到文件)angular.js:4361未捕获的错误:[$ 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 . js文件路径错误。

//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 用户/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. 服务器的路径不是C语言中的路径:它是服务器启动位置的相对路径。 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. 如果这是一个笨拙的Web服务器,请向我们显示您的构建文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在重载页面后的Angular js中,它说在使用$ locationProvider.html5Mode(true);之后服务器404上找不到错误; - In angular js after reloading page it say error on server 404 can not found the page after using $locationProvider.html5Mode(true); 在Windows中运行angular2-quickstart时的lite-server错误 - lite-server error while running angular2-quickstart in windows 从运行带有Angular JS的MySQL的PHP​​服务器获取数据时出错 - Error Fetching Data From a PHP Server Running MySQL with Angular JS 使用Angular.js加载页面时出现错误 - Getting error while loading my page using Angular.js 通过Angular JS路由后查看离子HTML页面时出错 - Error with viewing an ionic HTML page after routing through Angular JS HTML页面上显示“ angular-route.min.js”错误 - 'angular-route.min.js" Error is shown on the HTML page Angular JS不显示在HTML页面中 - Angular JS not displaying in HTML page Angular JS页面加载错误 - Angular JS page loading error 页面加载时如何在Angular JS控件中获取HTML元素值 - How can I get HTML element value inside Angular JS conroller while the page is getting loaded 作用域中的Array Object在读取子html页面时显示为空 - Array Object in a scope showing empty while reading in a child html page- angular JS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM