How to Sovle this Error

53 views
Skip to first unread message

Swapnil

unread,
Sep 13, 2020, 9:05:34 AM9/13/20
to Angular and AngularJS discussion
Access to XMLHttpRequest at 'http://localhost:53574/api/User' from origin 'http://localhost:4200' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.


zone.js:2969 GET http://localhost:53574/api/User net::ERR_FAILED


Pleas Help Me.

I am using Angular 6.

Kiflemariam Andom

unread,
Sep 13, 2020, 11:57:53 AM9/13/20
to ang...@googlegroups.com
Allow CORS on your backend for your angular app

--
You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/angular/f370a805-db73-4eee-b08a-8752a815635en%40googlegroups.com.

prudhvi raj ragi

unread,
Sep 17, 2020, 8:08:15 AM9/17/20
to ang...@googlegroups.com
Ask your backend developer to add cross origin like below example

@CrossOrigin(origins = "http://localhost:8090")
This is kind of static intialization . if you want to make it dynamic use * in place of 

http://localhost:8090

then it will be like 
@CrossOrigin(origins = "*")




--
Reply all
Reply to author
Forward
0 new messages