Avatar image for sunbro42
#1 Edited by sunbro42 (2 posts) -

I'm new to AngularTS and I'm having trouble getting data from the API.

I keep getting this error: "No 'Access-Control-Allow-Origin' header is present on the requested resource".
I've tried it with the JSONP format and that doesn't work. Does anyone know of a surefire way to get this API up and running with Angular TypeScript, a simple example would be much appreciated, cheers!

Avatar image for ascagnel
#2 Edited by ascagnel (154 posts) -

You've tripped a security feature of modern browsers: CORS. Mozilla has a pretty good breakdown of what you've run into: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Access-Control-Allow-Origin

(Sorry for the link, I'm on mobile and can't access the rich text tools)