Raghav
Raghav

Reputation: 69

CORS Filter Missing Angular

From my Angular client, i am invoking another application URL which will return a JSON object.

When i try in IE11 , it works fine but in Firefox and Chrome, i get: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at (Reason: CORS header 'Access-Control-Allow-Origin' missing).

I tried to add the Access-Control-Allow-origin in the header, i started get CORS Request Failed.

How can i handle this scenario in my angular 1.5 application?

Upvotes: 0

Views: 508

Answers (1)

Jorawar Singh
Jorawar Singh

Reputation: 7621

Access-Control-Allow-origin

First of all it has nothing to do with angular. You make an request to backend and your backend response to the request. CORS Filter Missing Angular there is no CORS Filter Missing Angular in angular but in your api. You need to set CORS Filter in your api so your angular application can make a request and api can response to that.

This picture describe how cors filter works

enter image description here

Upvotes: 2

Related Questions