2016-05-29 5 views
0

ではありません。

$scope.elencoTicket = function(){ 
     $http({method :"GET", 
       url :"./ajax/listaTicket.php", 
       params : {cliente:$scope.cliente}}) 
     .then(function(response){ 
      $scope.elencoTicket=response.data; 
     }); 
    } 


$scope.chiudiTicket = function(idTicket){ 
    $http({method:"GET", 
      url :"./ajax/chiudiTicket.php", 
      params:{idTicket:idTicket}}) 
    .then(function(response) { 
      console.log(response.data); 
      $scope.elencoTicket()}) 
    .catch(function(response){$scope.elencoTicket()}); 
} 

ザ・コール・アヤックスの両方が正常に動作しますが、プロセスの終わりに私はこのエラーを取得しますメッセージ: TypeError:$ scope.elencoTicketは関数ではありません

私の間違いはどこか分かりません。 あなたには良いアドバイスがありますか?

答えて

3

エラーがここにresponse.dataelencoTicket関数をオーバーライドしますが原因です:

$scope.elencoTicket = function(){ 
     $http({method :"GET", 
       url :"./ajax/listaTicket.php", 
       params : {cliente:$scope.cliente}}) 
     .then(function(response){ 
      // Here is the source of the error 
      $scope.elencoTicket=response.data; 

      // Solution: use another variable name 
      $scope.responseData=response.data; 
     }); 
    } 
関連する問題