simple update with PHP and angularJS

前端 未结 1 1791
伪装坚强ぢ
伪装坚强ぢ 2021-01-27 15:34

I want to update Num of $code, using PHP and AngularJS; but it updates only the last ng-repeat value, and not the clicked one.

HTM

1条回答
  •  爱一瞬间的悲伤
    2021-01-27 16:36

    Pass your x object as param to update function..

    Update
    
     $scope.update = function(x){ 
    
                 $http.post("http://localhost/deb/update.php",
                  {
                    'Code' :x.Code,                 
                  }
                  ).success(function(data){
                    alert(data);  
                 $scope.thisX = $state.params.Num; 
                  });  
           } 
    

    0 讨论(0)
提交回复
热议问题