Http.get not working in ios 9.2


#1

Hello,
I’m new to ionic and I developed an application that handles online orders and I use htt.get to recover data but as I compile android everything works; ios but I just can not recover the data on the emulator.
Can you help me thank you in advance.

My service:
‘use strict’;

app
.factory(‘zoneService’, function($http) {
var baseUrl = ‘http://www.my_domain.com/’;
return {
getAll: function() {
return $http.get(baseUrl+‘zone.php’);
}
};
});

my_controller :
‘use strict’;

app
.controller(‘HomeCtrl’, function($scope, $http, zoneService,PanierService){

zoneService.getAll().success(function(data){
$scope.zones = data.zones;
});

)};

my template:

Zone
---Please select---

#2

From the $http documentation :

 // Simple GET request example:
    $http({
      method: 'GET',
      url: '/someUrl'
    }).then(function successCallback(response) {
        // this callback will be called asynchronously
        // when the response is available
      }, function errorCallback(response) {
        // called asynchronously if an error occurs
        // or server returns response with an error status.
      });

Then can you log the data you are meant to receive, to see if you receive something at least ?

Last little thing : when you put HTML code in ionic posts, put it into code snippets so that we can see what you write