I was trying to play with simple $http call to my external server (apis and other stuff to load/update data).
As i’m developping i’m using ionic serve
$http is not working on my firefox or chrome due to CORS protection !
I lost about 2 hours to find it and the ionic blog post helped me
http://blog.ionic.io/handling-cors-issues-in-ionic/
I’ve created my proxies in ionic.project and constant on app.js.
I’ve not used the gulp way to replace “dev” version and “prod” version. Instead i’m using a simple if which work on dev and prod.
var url = API_PROD_URLS.'/myUrlsParams';
if (!window.cordova) // if current device is not a real one (ionic serve or ionic lab)
url = API_DEV_URLS.'/myUrlsParams';
$http.get(url) [...]
And everything is working like a charm.