Ive been beating myself over my head with this question and I've gone through a lot of documents online however none of them mentions how to create a header file. I know that that we implement Access-Control-Allow-Origin: * But I don't know where to implement it.
I'm trying to access a Json file in my local host Apache server, from get request in angular1.
i'm trying to acces the file however I keep getting cross origin sharing problem.
Could anyone answer where we implement the access control allow origin, The sources from internet say we implement it on the header file but where does the header file lie
app.controller("myCtrl",
function($scope,$http)
{
alert("This is finally working!!");
return $http.get('http://localhost/week10/resources/dog.json')
.then(
function(response)
{
$scope.dogObj = response.data;
})
});
My code looks something like this. Any help would be hugely appreciated!!!