Angular RequisitionJS

1

I'm starting with AngularJS and to study I created an application that I saw on the internet, but when I use the command "ng-include=" 'Footer.html' "inside the div it gives an error in the console.

angular.js: 12578 XMLHttpRequest can not load file: File Path. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.

I have already changed the permissions of the folder so everything has access and it still did not work.

    
asked by anonymous 20.03.2017 / 12:59

1 answer

2

You're probably opening the html file straight from a folder, using the file:// protocol, and Chrome does not allow the use of XMLHttpRequest for URLs of this type, so the error.

What you need is to use some http server, there are several simple to use, if you are using some IDE to develop it may already have some support, if you want to use some programming language for the backend it may be worth using the of it to do this, for example IISExpress if it will use ASP.Net or LAMP / WANP if it will use PHP.

    
20.03.2017 / 13:16