title: AngularJS send updated data to php page via $http.post
body: <p>I have just added the functionality to edit a table cell in my angularJS app. What I would like to do now is have the changes reflected in the database by sending the updated data to my PHP script, I'm a little stuck on how to actually resend the updated table.</p>
  
  <p>My Angular Table in question: </p>
  
  <pre><code>&lt;tr ng-repeat="c in resultValue=(data | filter:{'type':typeFilter} | filter:dateFilter | filter:proFilter | filter:cusFilter | filter:taskFilter | filter:nameFilter)"&gt;
  
      &lt;td class="jid" ng-hide="viewField"&gt;{{c.journal_id}}&lt;/td&gt;
      &lt;td ng-show="modifyField"&gt;&lt;input type="text" class="in1" ng-model="c.journal_id" /&gt;&lt;/td&gt;
  
      &lt;td class="wda" ng-hide="viewField"&gt;{{c.work_date}}&lt;/td&gt;
      &lt;td ng-show="modifyField"&gt;&lt;input type="text" class="in1" ng-model="c.work_date" /&gt;&lt;/td&gt; 
  
  &lt;/tr&gt;
       &lt;button ng-hide="viewField" ng-click="modify(c)"&gt;Modify&lt;/button&gt;
       &lt;button ng-show="modifyField" ng-click="update(c)"&gt;Update&lt;/button&gt;
  </code></pre>
  
  <p>The controller thanks to a SO answer for the edit part:</p>
  
  <pre><code>    journal.controller('dbCtrl', ['$scope', '$http', function ($scope, $http) {
  
            $scope.loadData = function () {
          $http.get("http://localhost/slick/journalFetch.php").success(function(data){
                  $scope.data = data;
              }).error(function() {
                  $scope.data = "error in fetching data";
              });
  }
  
    $scope.modify = function(c){
  
              $scope.modifyField = true;
              $scope.viewField = true;
          };
  
  
    $scope.update = function(c){
              $scope.modifyField = false;
              $scope.viewField = false;
  
            //AM I ABLE TO RESEND THE UPDATED (c) DATA HERE TO THE DATABASE ?
  
               $http({
                  method: "post",
                  url: "update.php",
                  data: {
                      //if so how to retrieve updated c data here?
                  }
               }); 
              };
    $scope.loadData();
  }]);
  </code></pre>