gpt4 book ai didi

javascript - angularjs中的ng-include抛出错误

转载 作者:行者123 更新时间:2023-11-30 15:54:46 27 4
gpt4 key购买 nike

我有这个代码:

<!DOCTYPE HTML>
<html>
<head>
<script src="angular.js"></script>
<script src="angularmy.js"></script>
<link rel="stylesheet" href="angular.css"/>
</head>
<body ng-app="myMod" ng-controller="myCont">
<div ng-include="'angular3.html'">
</div>
</body>
</html>

所有文件都在同一个文件夹中,甚至是 angular3.html,但是当我尝试运行它时会出现此错误:

Error: NETWORK_ERR ([arguments not available])@file://localhost/C:/Users/amondapr/Desktop/html/angularjs/ng-include/angular.js:12014 sendReq([arguments not available])@file://localhost/C:/Users/amondapr/Desktop/html/angularjs/ng-include/angular.js:11776 serverRequest([arguments not available])@file://localhost/C:/Users/amondapr/Desktop/html/angularjs/ng-include/angular.js:11571 processQueue([arguments not available])@file://localhost/C:/Users/amondapr/Desktop/html/angularjs/ng-include/angular.js:16383 ([arguments not available])@file://localhost/C:/Users/amondapr/Desktop/html/angularjs/ng-include/angular.js:16399 ([arguments not available])@file://localhost/C:/Users/amondapr/Desktop/html/angularjs/ng-include/angular.js:17682 ([arguments not available])@file://localhost/C:/Users/amondapr/Desktop/html/angularjs/ng-include/angular.js:17495 ([arguments not available])@file://localhost/C:/Users/amondapr/Desktop/html/angularjs/ng-include/angular.js:17790 bootstrapApply([arguments not available])@file://localhost/C:/Users/amondapr/Desktop/html/angularjs/ng-include/angular.js:1761 invoke([arguments not available])@file://localhost/C:/Users/amondapr/Desktop/html/angularjs/ng-include/angular.js:4718

有没有其他人遇到过这个问题,如果是那么如何解决?

最佳答案

您必须运行本地 http 服务器。

最简单的方法是使用在应用程序文件夹中运行的 python -m http.server(使用 Python 3)。然后你就可以访问 http://localhost:8000

关于javascript - angularjs中的ng-include抛出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38745810/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com