繁体   English   中英

Angular 2-加载资源失败:服务器响应状态为404(未找到)

[英]Angular 2 - Failed to load resource: the server responded with a status of 404 (Not Found)

在文件index.html中,我已导入文件config: <script src="http://localhost:4200/src/config.js"></script>文件config.js与索引位于同一文件夹中.html,但是当我在项目中吃午餐时,它在控制台上给了我这个错误:无法加载资源:服务器以404状态(未找到)进行了响应

您无需在src中提及localhost。

<script src="./config.js"></script>

暂无
暂无

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

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