Javascript Don';t从PHP服务器/离子应用程序-AngularJS获取JSON数据

Javascript Don';t从PHP服务器/离子应用程序-AngularJS获取JSON数据,javascript,php,angularjs,ionic-framework,Javascript,Php,Angularjs,Ionic Framework,我搜索了每一个主题,但没有找到答案。 我只是想把这个地址的数据输入我的ionic应用程序, 但要始终做到这一点: {"$$state":{"status":0}} 我在一家工厂工作: .factory('Markers', function($http) { var markers = []; return { getMarkers: function(){ return $http.get("http://geofence.obcc-dd.webseiten.

我搜索了每一个主题,但没有找到答案。 我只是想把这个地址的数据输入我的ionic应用程序, 但要始终做到这一点:

{"$$state":{"status":0}}
我在一家工厂工作:

.factory('Markers', function($http) {

 var markers = [];

    return {
    getMarkers: function(){

    return $http.get("http://geofence.obcc-dd.webseiten.cc/marian/markers.php").then(function(response){
      markers = response;
      return markers;
        });

        } }})
此控制器代码:

.controller('MapCtrl', function($scope, $state, $cordovaGeolocation, Markers) {
 var options = {timeout: 10000, enableHighAccuracy: true};

    $cordovaGeolocation.getCurrentPosition(options).then(function(position){

       console.log("Data:");  
       console.log(Markers.getMarkers()); //here the 0-state appears...

   var latLng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
我无法处理和使用所需的数据。
请帮帮我-我吓坏了;(

这将帮助您确定

像这样调用您的服务方法

Markers.getMarkers(function(response){

 console.log(response); 

}); 
getMarkers: function(callback){

 $http.get("http://geofence.obcc-dd.webseiten.cc/marian/markers.php").then(function(response){
callback(response)
        });
} }})
然后像这样定义您的服务方法

Markers.getMarkers(function(response){

 console.log(response); 

}); 
getMarkers: function(callback){

 $http.get("http://geofence.obcc-dd.webseiten.cc/marian/markers.php").then(function(response){
callback(response)
        });
} }})
还有其他方法,但最好的已经给出了,请让我知道代码的输出,因为它并没有经过测试。 如果需要清晰的解决方案,请发布代码片段或创建plunker