1

I have this code:

<!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>

All the files are in the same folder, even angular3.html but when I try to run it gives me this error :

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

Has anyone else faced this problem , if yes then how to correct it ?

5
  • I think you need to put your angular app on a webserver (like wampserver, or a vagrant box) Commented Aug 3, 2016 at 14:02
  • But why??? The tutorials that i am following have their html file in the same directory Commented Aug 3, 2016 at 14:05
  • yes, but the whole directory is served through a http server. Commented Aug 3, 2016 at 14:05
  • Take a look at that question Commented Aug 3, 2016 at 14:08
  • You won't be able to load the angular3.html template file if you don't use a web server. What you can do to test this without a server is to use an inline-template <script type="text/ng-template" id="angular3.html"> more details here Commented Aug 3, 2016 at 14:09

2 Answers 2

2

You have to run a local http server.

Easiest way is using python -m http.server (with Python 3) running in application folder. Then you can just access http://localhost:8000

Sign up to request clarification or add additional context in comments.

Comments

0

If you are on Mac you can use MAMP

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.