2

I am using AngularJS v1.1.5 and try to load templates using ng-include,

Failed to load resource: Origin null is not allowed by Access-Control-Allow-Origin. file:///E:/apps/partials/holidayList.html

XMLHttpRequest cannot load file:///E:/apps/partials/holidayList.html. Origin null is not allowed by Access-Control-Allow-Origin. 

i have already tried command line options for chrome, it not working for me to disable the policy and i don't want command line options, Any thing i need to edit in anguarjs file

4
  • Use a Webserver to serve the files. Something like apache. Then you can access the files via localhost/.../holidayList.ht
    – tschiela
    Aug 5, 2013 at 8:27
  • Or Start chrome with the Parameter --allow-running-insecure-content
    – tschiela
    Aug 5, 2013 at 8:29
  • I don't want to use Web Server Aug 5, 2013 at 8:29
  • Hi tschiela Your command is not working Aug 5, 2013 at 8:41

1 Answer 1

8

You need to open your chrome with following command. (Press window+R)

Chrome.exe --allow-file-access-from-files

Note : Your chrome must not be open. When you run this command chrome will open automatically.

If you are entering this command in command prompt then select your chrome installation directory then use this command.

0

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.