I am a novice to angular.js, and I am trying to add some headers to a request:
var config = {headers: {
\'Authorization\': \'Basic d2VudHdvcnR
And what's the answer from the server? It should reply a 204 and then really send the GET you are requesting.
In the OPTIONS the client is checking if the server allows CORS requests. If it gives you something different than a 204 then you should configure your server to send the correct Allow-Origin headers.
The way you are adding headers is the right way to do it.