在文件index.html中我导入了一个文件config: <script src="http://localhost:4200/src/config.js"></script> 文件config.js它与index.html位于同一个文件夹中,但是当我在午餐时,它在控制台给我这个错误:无法加载资源:服务器响应状态为404(未找到)
您不需要在src中提及localhost .
<script src="./config.js"></script>
1 回答
您不需要在src中提及localhost .