title: How to filter and sort array elements in ngtable?
body: <p>I have an array which I am using in ngtable, but need help in filtering data I am not able to do sort when I click on the header. Please help</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;table class="table" ng-table="namingConventionParams" show-filter="true"&gt;
      &lt;tr ng-repeat="item in $data | orderBy:'toString()'"&gt;
          &lt;td style="word-break:break-all" data-title="items.tableHeader" align="left" filter="{ '0': 'text' }" sortable="'valueOf()[0]'"&gt;{{item}}&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>$scope.namingConventionParams = new ngTableParams({
      page: 1, // show first page
      count: 10
  }, {
      defaultSort: "asc",
      total: $scope.items.instanceData.length, // length of data
      counts: [],
      getData: function($defer, params) {
          var data = $scope.items.instanceData;
          var orderedData = params.filter() ? $filter('filter')(data, params.filter()) : data;
              orderedData = params.sorting() ? $filter('orderBy')(orderedData, params.orderBy()) : orderedData;
              params.total(orderedData.length);
              $defer.resolve(orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count()));            
      }
  });
  </code></pre>
  
  <p><a href="http://plnkr.co/edit/NnmvNXW4xbe2vw0VEO9L?p=preview" rel="nofollow">Plunker link</a></p>