title: Angularjs wrong $index after orderBy
body: <p>I am new to Angular.js and have some problems sorting my array and working on that sorted data.</p>
  
  <p>I have a list with items and want so sort it by "Store.storeName", which is working so far. But after sorting the data, my delete-function is not working anymore. I think thats because the $index is wrong after sorting, and so the wrong data is deleted. </p>
  
  <p>How can I solve that? Ordering the data in the scope and not in the view? How to do that?</p>
  
  <p>Here is some relevant code:</p>
  
  <p>In the View:</p>
  
  <pre><code>&lt;tr ng-repeat="item in items | orderBy:'Store.storeName'"&gt;
                  &lt;td&gt;&lt;input class="toggle" type="checkbox" ng-model="item.Completed"&gt;&lt;/td&gt;
                  &lt;td&gt;{{item.Name}}&lt;/td&gt;
                  &lt;td&gt;{{item.Quantity}} Stk.&lt;/td&gt;
                  &lt;td&gt;{{item.Price || 0 | number:2}} €&lt;/td&gt;                
                  &lt;td&gt;{{item.Quantity*item.Price|| 0 | number:2}} €&lt;/td&gt;
                  &lt;td&gt;{{item.Store.storeName}}&lt;/td&gt; 
                  &lt;td&gt;&lt;a&gt;&lt;img src="img/delete.png" ng-click="removeItem($index)"&gt;{{$index}}&lt;/a&gt;&lt;/td&gt;
              &lt;/tr&gt;
  </code></pre>
  
  <p>And in my controller I have this delete function, which should delete the specific data:</p>
  
  <pre><code>$scope.removeItem = function(index){
          $scope.items.splice(index,1);
      }
  </code></pre>
  
  <p>This works nicely before ordering in the View. 
  If something important is missing, please let me now.</p>
  
  <p>Thanks!</p>