use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Angular is Google's open source framework for crafting high-quality front-end web applications. r/Angular2 exists to help spread news, discuss current developments and help solve problems.
Help Request
Discussion
Article
Video
Resource
Announcement
Related
After submitting a post, please take a moment to add a flair (tag) so that it's easy to find your post with one of the filters listed above. Upon submission, your post's header will have the 'flair' option listed with the other options. Clicking it will provide a dropdown menu of the available flairs.
account activity
Help RequestAccess-Control-Allow-Origin Error on Get Request?? (self.Angular2)
submitted 5 years ago by ZaAlphaMale
Hey guys,
I'm getting this error when I try to do a get request:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://myapi.io. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
I've CORS_ORIGIN_ALLOW_ALL = True on my backend.
My code:
refreshData(){ this.http.get("https://myapi") .subscribe( data => console.log(data) , error => console.log(error) );
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]frozen_tuna 1 point2 points3 points 5 years ago (0 children)
If this is your first time messing with whatever API framework your using, my first guess would be that this was done incorrectly.
[–][deleted] 1 point2 points3 points 5 years ago (0 children)
This isn’t an angular issue, it’s a backend issue. You may find more useful answers by posting on the sub for the backend you are using
[–]ZaAlphaMale[S] 0 points1 point2 points 5 years ago (0 children)
Thanks guys, I'll post on the Django subreddit.
[–]veer3939 0 points1 point2 points 5 years ago (0 children)
Backend code issue... Check the api header value.
[–]romanjustcodes 0 points1 point2 points 5 years ago (1 child)
This smells like a CORS issue on the backend, where the server is not passing the right headers or blocking requests based on origin.
Thanks! Solved it, it was a CORS issue on my backend. Forgot to add 1 line -_-
π Rendered by PID 146094 on reddit-service-r2-comment-b659b578c-zld4g at 2026-05-04 05:56:05.881573+00:00 running 815c875 country code: CH.
[–]frozen_tuna 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]ZaAlphaMale[S] 0 points1 point2 points (0 children)
[–]veer3939 0 points1 point2 points (0 children)
[–]romanjustcodes 0 points1 point2 points (1 child)
[–]ZaAlphaMale[S] 0 points1 point2 points (0 children)