Angularjs:无法加载资源:Chrome 中的 Access-Control-Allow-Origin 不允许 Origin null [英] Angularjs: Failed to load resource: Origin null is not allowed by Access-Control-Allow-Origin in chrome
问题描述
我正在使用 AngularJS v1.1.5 并尝试使用 ng-include 加载模板,
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.
我已经尝试过 chrome 的命令行选项,禁用该策略对我不起作用,我不想要命令行选项,我需要在 anguarjs 文件中编辑任何内容
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
推荐答案
您需要使用以下命令打开您的 chrome.(按窗口+R)
You need to open your chrome with following command. (Press window+R)
Chrome.exe --allow-file-access-from-files
注意:您的 chrome 不能打开.当您运行此命令时,chrome 将自动打开.
Note : Your chrome must not be open. When you run this command chrome will open automatically.
如果您在命令提示符下输入此命令,请选择您的 chrome 安装目录,然后使用此命令.
If you are entering this command in command prompt then select your chrome installation directory then use this command.
这篇关于Angularjs:无法加载资源:Chrome 中的 Access-Control-Allow-Origin 不允许 Origin null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!