AngularJS Error: Cross origin requests are only supported for protocol schemes: http, data, chrome-extension, https

This error is happening because you are just opening html documents directly from the browser. To fix this you will need to serve your code from a webserver and access it on localhost. If you have Apache setup, use it to serve your files. Some IDE’s have built in web servers, like JetBrains IDE’s, Eclipse…

If you have Node.Js setup then you can use http-server. Just run npm install http-server -g and you will be able to use it in terminal like http-server C:\location\to\app.

Leave a Comment