title: how to make a server side pagination with angularjs $resource ?
body: <p>I am trying to display a table with a large collection of elements. I want to paginate the table and load only the elements displayed on the current page. Now, the json is loaded with <code>$resource</code>. </p>
  
  <p>I read <a href="https://stackoverflow.com/a/14180451/2112538">here</a> that it's a good idea to pass the pagination infos (currentPage, pagesCount and elementsCount) inside the json header. </p>
  
  <p><strong>How can I access to those infos which are in the json header from angular?</strong></p>
  
  <p>Here is the basic js structure: </p>
  
  
  
  <pre class="lang-js prettyprint-override"><code>angular.module('App.services', ['ngResource']).
  factory('List', function($resource){
      return $resource('url/of/json/:type/:id', {type:'@type', id:'@id'});
  });
  
  
  angular.module('App.controllers', []).
  controller('ListCtrl', ['$scope', 'List', function($scope, List) {
      var $scope.list= List.query({offset: 0, limit: 100, sortType: 'DESC' });
  }]);
  </code></pre>