Help with CORS issue

Hi Guys,

I just found ionic and create a project by issuing the command: ionic start myApp tabs.

The sample works beautifully, however when I push the friends list to a remote MySQL server and getting into Cross-Origin Request Blocked issue. The only part got changed was in services.js

angular.module(‘’, [‘ngResource’])
.config([’$httpProvider’, function($httpProvider) {
$httpProvider.defaults.useXDomain = true;
delete $httpProvider.defaults.headers.common[‘X-Requested-With’];
]).factory(‘Friends’, [’$http’, function ($http) {
var friends = {};
return {
all : function () {
var friends = $http({method: “GET”, url:“”});
return friends;
get: function(friendId) {
// Simple index lookup
return friends[friendId];


The works in another Angularjs Task Manager example without CORS issue, but don’t know what I have to do to get it work. Please Help, Thanks.

Not sure if you’ll find it helpful but you can always disable web security in your browser

I would say nothing is better than this :

remember when u run on mobile devices, you dont need to proxy, but its only on browser