first of all i am on developing a mobile app using ionic framework
in one factory i need to talk to a server side which is not in my domain (cross domain request)
i used this code and it never works for me
$http.get({
url: 'http://test.wilson34.com/test.php',
data: {
"name": "peter"
}
}).
success(function(data, status, headers, config) {
// this callback will be called asynchronously
// when the response is available
console.log('Success' + data);
alert(data)
}).
error(function(data, status, headers, config) {
console.log('Status : ' + status);
});
but when do it using jQuery it works like charm
jQuery.ajax({
url: 'http://test.wilson34.com/test.php',
data: {
"name": "peter"
}
}).
success(function(data, status, headers, config) {
// this callback will be called asynchronously
// when the response is available
console.log('Success' + data);
alert(data)
}).
error(function(data, status, headers, config) {
console.log('Status : ' + status);
});
please help i will not use jQuery in my project , any suggestions t do it using $http in angularJs
thanks in advance