@etl wrote:
Hi,
I'm new to Ionic and I'm trying to make a $http get request to a php file on localhost but it returns an error with status -1 and data null. Running the url directly from the browser returns a JSON array with no problem. Angularjs documentation states: "-1 usually means the request was aborted, e.g. using a config.timeout" but I have no idea how to fix this.I'm making the request as follows:
$http.get('http://localhost:8888/testQuery.php').then(function(response){
//the response from the server is now contained in 'response'
alert('success')
}, function(error){
//there was an error fetching from the server
alert(JSON.stringify(error))
});
Posts: 1
Participants: 1