Access-controll-allow-origin is not allowed

hello guys
im using $http to get a json file but when i view it by console.log() throw me following error :

XMLHttpRequest cannot load Origin http://localhost:8100 is not allowed by Access-Control-Allow-Origin.

i followed this post [](cors issue) to use proxy but it give me 404 error!!

can anyone help me ?


did you try with jsonp?

1 Like

thanks.its worked by using $http.jsonp(), but why it does not work with $http.get() ?!

Maybe because you are trying to reach some some domain that does not allow cross domain.

Here you can read more about this.

1 Like