CORS, Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources(e.g. fonts, JavaScript, etc.) on a web page to be requested from another domain outside the domain from which the resource originated.
Sometimes in IONIC if we are sending an AJAX request to server we get an error like this
To handle such an error we have to enable CORS.
How to handle CORS in ionic
To enable CORS create another parameter inside ionic.project file as follow:
Now where you want to send request on an url send it as
It will proxy requests out to http://SERVER_URL/api on your behalf.
Source :- http://blog.ionic.io/handling-cors-issues-in-ionic/