Error message 'XMLHttpRequest cannot load. Cross origin requests are only supported for HTTP in AngularJS'

If this is for local development and you are using Chrome, you need to run Chrome with a couple of arguments to relax security like this:

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --allow-file-access-from-files --disable-web-security

I fixed this problem by running my page off a server, like this

cd /path/to/dir/with/the/index/file
python3 -m http.server

then open http://localhost:8000 in your browser.

For other ways of serving the current directory, see this question.


For Mac users the respective command would be:

open /Applications/Google\ Chrome.app --args --allow-file-access-from-files --disable-web-security

Update:

open -n -a /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --args --user-data-dir="/tmp/chrome_dev_test" --allow-file-access-from-files --disable-web-security

Source