title: Angularjs ng-table with AJAX data source, sorting and filtering
body: <p>I'm trying to apply the <a href="https://github.com/esvit/ng-table" rel="nofollow noreferrer"><code>ngTable directive</code></a> to my Rails app, but can't get it right. I'm still a newbe in angular and this directive seems very poorly documented (though has a great variety of nice examples). </p>
  
  <p>So I have an array called <code>$scope.users</code> containing all the users info I need (e.g. <a href="http://www.json-generator.com/api/json/get/cwbFIUNCBe?indent=2" rel="nofollow noreferrer">like this</a>), which comes from a <code>$resource</code> <code>query()</code>.</p>
  
  <p>And I need to turn it into a table with:</p>
  
  <ol>
  <li>Sorting</li>
  <li>Pagination</li>
  <li>Filtering from one input (like done <a href="http://embed.plnkr.co/llb5k6/preview" rel="nofollow noreferrer">over here</a>)</li>
  </ol>
  
  <p>Can someone provide a solution or at least an advice how to put it all together?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>So, with great help of wafflejock on the irc channel I've been able to put together some of the functionality. Here's <a href="http://plnkr.co/edit/8PAaUZ?p=preview" rel="nofollow noreferrer">the plunk</a>.</p>
  
  <p>What is still wrong:</p>
  
  <ol>
  <li>The json dataset gets requested every time I change the page, the sorting or anything else. That's a huge amount of requests, so I need it to get cached somehow. </li>
  <li>I need to be able to manipulate the dataset from the controller to change the values and remove users if need be. Still have no idea how to implement that. </li>
  </ol>