我有這樣的代碼:NG-包括angularjs拋出錯誤
<!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
有沒有其他人遇到過這個問題,如果是的話怎麼改正呢?
我認爲你需要把你的應用程序的角度在網絡服務器上(如wampserver或無業遊民箱) –
但爲什麼???我正在關注的教程將他們的html文件放在同一目錄 – YepMe
是的,但是整個目錄通過http服務器提供。 –