Question from the Ionic Framework test

How to make an API call in Ionic

Hard

Imagine an application that connects to an API. You launch your application in the browser with ionic serve.

Here is the result of the request to the API:

XMLHttpRequest cannot load http://api.ionic.com/endpoint. No 'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'http://localhost:8100' is therefore not allowed access.

How to solve this error?

Author: Benjamin CanacStatus: PublishedQuestion passed 116 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!