title: How to delete data from Json object in angular js?
body: <p>I'm trying to delete the element in Angular JS. When the user click the action button the card view suppose to be deleted but it's not deleted in HTML View but in backend nodejs &amp; DB data has been deleted. When i refresh the element has been deleted all i want is when i click the button the from HTML the card view has to be deleted and also in DB? Pls help me to fix this problem?</p>
  
  <p>HTML View</p>
  
  <pre><code>&lt;md-card ng-repeat="user in data"  class="color"   ng-style="user.changeColor"&gt; 
      &lt;md-card-title&gt;
          &lt;md-card-title-text style=""&gt;
              &lt;span class="md-headline"&gt;Name:{{user.name}}&lt;/span&gt;
              &lt;span class="md-headline"&gt;Mobile:{{user.mobile_no}}&lt;/span&gt;
          &lt;/md-card-title-text&gt;
      &lt;/md-card-title&gt;
  
      &lt;md-input-container&gt;
        &lt;label&gt;Meter ID&lt;/label&gt;
        &lt;input ng-model="meter" required md-maxlength="10" type="text" &gt;
      &lt;/md-input-container&gt;
  
      &lt;md-button class="color1" ng-click="meterID(user,meter)" &gt;
              Action
      &lt;/md-button&gt;
  &lt;/md-card&gt;
  </code></pre>
  
  <p>Angular JS Code</p>
  
  <pre><code>.controller('userCtrl',function($scope,$rootScope,$http){
      $scope.test="Hello Raam"
      $scope.meter;
  
      $http.get('http://localhost:8888/json').success(function(response){
          $scope.data=response;
          console.log($scope.data)
      })
  
      $scope.meterID=function(user,meter,x){
          console.log("User",user);       
          console.log("Meter",meter)
  
          user.changeColor={
              "background-color":"green",         
          }
          console.log(user.name);
  
          $scope.userMeter={          
              name:user.name,
              mobile:user.mobile_no,
              appartment:user.appartment,
              street:user.street,
              city:user.city,
              pincode:user.pincode,
              meterID:meter
          }
  
          console.log("UserMeter",$scope.userMeter);
  
  
              $http.post('http://localhost:8888/meterID',$scope.userMeter).success(function(response){
                  console.log("value has been successfully updated");
                  $scope.data1=response;
                  console.log("$scope.data1",$scope.data1)
              })
  
              $http({
                  method: 'DELETE',
                  url: 'http://localhost:8888/deleteRegisterUser',
                  data: user,
                  headers: {'Content-Type': 'application/json;charset=utf-8'}
              }).success(function (data, statusText ){
                      console.log("value has been successfully Deleted",data );
  
                  })
              }
  })
  </code></pre>
  
  <p>NodeJS:</p>
  
  <pre><code>app.delete('/deleteRegisterUser', function(req,res){
              var mob=req.body.mobile_no;
                  console.log("deleteRegisterUser : ",mob)
                  // res.send(data)
              con.query("DELETE from water_register WHERE mobile_no = ?",mob,function (err,rows){
                  if(err) throw err;
                  console.log("Value has been deleted")
                  // res.send(rows);
                   res.redirect('/dashboard');
              })  
      })
  </code></pre>