I’ve always used this service with no problem, but now every time a invoke the $http.get i receive a “0 ()” in return and no error is displayed.
I read a little around and i found a problem with cordova > 4 (i have 7.0.0) and the whitelist-plugin, as described here: Same question on stackoverflow
I followed instructions but i still got the problem.
I also read something about requests that should be made in https, but my site is not https… i cannot even try
I leave a snippet of my code.
This is how i use the service
angular.module("starter").factory("cercaSrv", ["$http", function($http) {
return {
searchFor: function(datiObj, device) {
return $http.get("http://mysite/cerca.php?data=" + datiObj + "&device=" + device);
}
};
}]);
Here i call it:
cercaSrv.searchFor($stateParams.ricerca, ionic.Platform.device().uuid)
.then(onSearchOk, onError);
I always ended in the OnError function
Does anyone have an idea of what i could do?
thanks in advance