title: How to properly delete selected items ui.grid Angular JS
body: <p>I am having some difficulties understanding the properties/functions available through ui-grid. I often get confused with its previous version ng-grid.  I am trying to find what the best way of deleting a checked-entry would be. Here is my markup, but due to not quite understanding if I have an index, or count available through a row entity:</p>
  
  <p>HTML: </p>
  
  <pre><code>       &lt;div class="form-group"&gt;
            &lt;button type="button" id="addData" class="btn btn-success" ng-click="addData()"&gt;Add Data&lt;/button&gt;
            &lt;button type="button" id="removeData" class="btn btn-success" ng-click="removeData()"&gt;Remove First Row&lt;/button&gt;
            &lt;br&gt;
            &lt;br&gt;
            &lt;div id="grid1" ui-grid="gridOptions" ui-grid-edit ui-grid-selection external-scopes="myViewModel" class="grid"&gt;&lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>which lies under my controller: </p>
  
  <pre><code> $scope.removeData = function () {
          console.log($scope.gridApi.selection.getSelectedRows());
  
          var items = $scope.gridApi.selection.getSelectedRows();
  
          angular.forEach($scope.myData, function (data, index) {
              angular.forEach(items, function (item) {
                  if (item.displayValue = data.displayValue)
                  {
                      $scope.myData.splice(index, 1);
                  }
  
              });
  </code></pre>
  
  <p>where <code>displayValue</code> is a property of my column and <code>$scope.myData</code> is my data.  Is there a different way to send that selection to the controller for removal? The current way I have it does NOT work (obviously).  Any help will be appreciated.  If my markup is incomplete, I'll update it as necessary. Thank you!</p>