REST api with angular js shows Access header error, works when called directly from browser URL

36 views Asked by At

I have created REST API on server and provided URL to other users.. It returns JSON file when requested from browser address. BUT While using that API in html page with AngularJS provided an error 'No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.'

1

There are 1 answers

4
DvTr On

You should enable CORS in your REST API