I'm getting a CORS
header missing error. I can't modify the code of the back end web service, I can only change the client side application.
I can add the "Allow control allow origin
" addon on google chrome but I don't want to install the add on all the clients to access the api. How can i change my AngularJS
code so that I will not get this issue?
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function ($scope, $http) {
$http.get('url', {
headers: { 'Authorization': 'Basic a2VybmVsc3B==' }
})
.then(function (response) {
$scope.names = response.data;
});
});
</script>