title: Reorder a list without ng-repeat
body: <p>For reasons I won't go into, I'm not using ng-repeat for a list of items.</p>
  
  <p>I have a list like this:</p>
  
  <pre><code>    &lt;p&gt;Search: &lt;input type="text" ng-model="search"&gt;&lt;/p&gt;
  
      &lt;div id="grid" filter-list="search"&gt;
  
        &lt;div id="item1" class="[list of properties]"&gt;
        //item content
        &lt;/div&gt;
        &lt;div id="item2" class="[list of properties]"&gt;
        //item content
        &lt;/div&gt;
  
        &lt;div id="item3" class="[list of properties]"&gt;
        //item content
        &lt;/div&gt;
  
        &lt;div id="item4" class="[list of properties]"&gt;
        //item content
        &lt;/div&gt;
  
      &lt;/div&gt;
  </code></pre>
  
  <p>As you can see I already have a search function working well.</p>
  
  <p>My app script looks like this:</p>
  
  <pre><code>&lt;script&gt;
      var app = angular.module('myApp', []).controller('MainCtrl', function ($scope, $timeout) {
  
      });
  
  
  
      app.directive('filterList', function ($timeout) {
          return {
              link: function (scope, element, attrs) {
  
                  var div = Array.prototype.slice.call(element[0].children);
  
                  function filterBy(value) {
                      div.forEach(function (el) {
                          el.className = el.textContent.toLowerCase().indexOf(value.toLowerCase()) !== -1 ? '' : 'ng-hide';
                      });
                  }
  
                  scope.$watch(attrs.filterList, function (newVal, oldVal) {
                      if (newVal !== oldVal) {
                          filterBy(newVal);
                      }
                  });
              }
          };
      });
  
  
  
  &lt;/script&gt;
  </code></pre>
  
  <p>The problem is I need to be able to reorder the list based on class values or even the ids (At this stage it doesn't matter).</p>
  
  <p>Every tutorial/guide online assumes that the code uses "ng-repeat" ... which I simply can't use here.</p>
  
  <p>Is there any way I can get the items to reorder without using ng-repeat?</p>