simple update with PHP and angularJS

前端 未结 1 1786
伪装坚强ぢ
伪装坚强ぢ 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..

    <a class="button button-info" ng-click="update(x)">Update</a>
    
     $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)
提交回复
热议问题