title: Refresh ng-repeat data
body: <p>I have a big list containing all of my data, and I have another shorter list containing only the selected data.
  Originally, all the data is selected so both lists are identical, and the user must uncheck the checkbox of the unwanted data, and then the unchecked data must disappear from the selected_data_list.</p>
  
  <p>When the page is loaded, the two lists are being filled correctly. But when I uncheck the unwanted data, the selected_data_list is not updating.</p>
  
  <p>I tried to use $scope.$apply(), but it gave me this error:</p>
  
  <blockquote>
    <p>Error: $rootScope:inprog
    Action Already In Progress</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <h2>Complete list:</h2>
  
  <pre><code>&lt;div ng-controller="BrainRegionsCtrl"&gt;
  
      &lt;div ng-repeat="region in brain_regions"&gt;
  
          &lt;label&gt; 
  
             &lt;input type="checkbox"
                name="checkbox_brain_region__included"
                id="checkbox_brain_region_{/region.id/}"
                value="{/region.id/}"              
                ng-model="region.show"
                ng-change="update_selected_Brain_regions(region)"&gt;                           
  
             &lt;b&gt;{/region.name/}&lt;/b&gt;
  
           &lt;/label&gt;
  
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <h2>Selected regions list:</h2>
  
  <pre><code>&lt;div ng-controller="BrainRegionsCtrl"&gt;
  
      &lt;label ng-repeat="region in selected_brain_regions"&gt;
          &lt;input type="radio" name="radio_brain_regions_graphical_search_soma" value="{/region.id/}"&gt;
          &lt;b&gt;{/region.name/}&lt;/b&gt;
      &lt;/label&gt;
  
   &lt;/div&gt;
  </code></pre>
  
  <h2>Controller:</h2>
  
  <pre><code>ngApp.controller('BrainRegionsCtrl', function ($scope, $http) {
  
      $scope.brain_regions = [];
      $scope.selected_brain_regions = [];               
  
      $scope.update_selected_Brain_regions = function (region) {
  
          for (var i = 0; i &lt; $scope.brain_regions.length; i++) {
              var current_region = $scope.brain_regions[i];
              if (current_region.id === region.id) {
                  if (region.show) {
                      $scope.selected_brain_regions.push(current_region);
                  }
                  else {
                      $scope.selected_brain_regions.splice(i,1);
                  }
              }
          }
          console.log($scope.selected_brain_regions);
  
      };
  
  });
  </code></pre>
  
  <p>Here is a <a href="https://jsfiddle.net/qc4scy4r/4/" rel="nofollow noreferrer">jsfiddle</a>
  Thank you.</p>